-
Notifications
You must be signed in to change notification settings - Fork 1
/
launch.sh
74 lines (58 loc) · 1.48 KB
/
launch.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
#!/bin/sh
#BSUB -n 8 # n processes
#BSUB -q g_devel # queue
#BSUB -P R000 # project
#BSUB -R "span[ptile=2]" # n gpu per node
#BSUB -J wildfires # jobname
#BSUB -o job-%J.out
#BSUB -e job-%J.err
#BSUB -gpu "num=2"
echo Start the program " "
echo ""
set -e
# Create experiments that must be performed
DO_EXPS=false
EXPERIMENTS=experiments.py
if $DO_EXPS
then
echo Creating experiments... " "
echo ""
python $EXPERIMENTS
fi
# Define TOML configuration filepaths
TOML_16="$PWD/config/experiments/UPP_16.toml"
TOML_32="$PWD/config/experiments/UPP_32.toml"
TOML_64="$PWD/config/experiments/UPP_64.toml"
TOML_ALL="$PWD/config/experiments/UPP_all.toml"
# Define main python file that must be executed
MAIN=main.py
# Flag to choose if multiple experiments must be done
MULTIPLE_EXPS=true
# Starting and ending experiment numbers
FROM=4
TO=4
from_value="$FROM"
to_value="$TO"
# Command to execute Python program and to use MPI to parallelize model and data
echo Start training... " "
echo ""
if $MULTIPLE_EXPS
then
if [[ $from_value -le $to_value ]]; then
order="Ascending"
exp_range=($(seq "$from_value" "$to_value"))
else
order="Descending"
exp_range=($(seq "$to_value" -1 "$from_value"))
fi
echo "Performing experiment in $order order"
for exp_num in "${exp_range[@]}"; do
echo "Experiment: $exp_num"
echo "Running experiment... $exp_num"
mpirun python $MAIN -c $TOML_ALL -nexp $exp_num
done
else
mpirun python $MAIN
fi
# End of script
echo "Program ended"