-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjob.sh
More file actions
35 lines (28 loc) · 861 Bytes
/
job.sh
File metadata and controls
35 lines (28 loc) · 861 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
# untar python installation and make sure the script uses it
tar -xzf python39.tar.gz
export PATH=$PWD/python/bin:$PATH
rm python39.tar.gz
# fetch your packages from /staging/
cp /staging/ncorrado/packages.tar.gz .
tar -xzf packages.tar.gz
rm packages.tar.gz
# make sure python knows where your packages are
export PYTHONPATH=$PWD/packages
# fetch your code from /staging/
CODENAME=chtc
cp /staging/ncorrado/${CODENAME}.tar.gz .
tar -xzf ${CODENAME}.tar.gz
rm ${CODENAME}.tar.gz
cd $CODENAME
pip install -e .
cd $CODENAME
pid=$1
step=$2 #ranges from 0 to num_jobs-1
cmd=$3
echo $cmd $pid $step
# run your script
# $step ensures seeding is constistent across experiment batches
$($cmd --run-id $pid --seed $step)
# compress results. This file will be transferred to your submit node upon job completion.
tar czvf results_${pid}.tar.gz results