-
Notifications
You must be signed in to change notification settings - Fork 0
/
sbatch_pyro.sh
94 lines (82 loc) · 2.3 KB
/
sbatch_pyro.sh
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/bash
# Default resources are 1 core with 2.8GB of memory per core.
# job name:
#SBATCH -J pyro_sampler
# priority
##SBATCH --account=carney-frankmj-condo
# output file
#SBATCH --output slurm/pyro_sampler_%A_%a.out
# Request runtime, memory, cores
#SBATCH --time=32:00:00
#SBATCH --mem=8G
##SBATCH -c 4
#SBATCH -N 1
##SBATCH -p gpu --gres=gpu:1
#SBATCH --array=0-19
# --------------------------------------------------------------------------------------
# Setup
source /users/afengler/.bashrc
module load cudnn/8.1.0
module load cuda/11.1.1
#module load cuda/11.3.1
module load gcc/10.2
conda deactivate
conda deactivate
conda activate lanfactory
# Read in arguments:
model=ddm
modeltype=hierarchical
nsteps=1000
nparticles=2
guide=normal
machine=cpu
idrange=10
progressbar=0
nvidia-smi
lscpu
while [ ! $# -eq 0 ]
do
case "$1" in
--model | -m)
echo "passing model $2"
model=$2
;;
--modeltype | -t)
echo "passing modeltype $2"
modeltype=$2
;;
--machine | -m)
echo "passing modeltype $2"
machine=$2
;;
--nsteps | -s)
echo "passing nsteps $2"
nsteps=$2
;;
--nparticles | -p)
echo "passing nparticles $2"
nparticles=$2
;;
--guide | -g)
echo "passing guide $2"
guide=$2
;;
--progressbar | -b)
echo "passing model $2"
progressbar=$2
;;
--idrange | -i)
echo "passing idrange $2"
idrange=$2
esac
shift 2
done
python -u run_inference_pyro.py --model $model \
--modeltype $modeltype \
--nsteps $nsteps \
--nparticles $nparticles \
--machine $machine \
--progressbar $progressbar \
--guide $guide \
--idmin $((SLURM_ARRAY_TASK_ID*idrange)) \
--idmax $((SLURM_ARRAY_TASK_ID*idrange + idrange))