Skip to content

Commit 15320a9

Browse files
committed
Update job scripts
1 parent 234931d commit 15320a9

File tree

4 files changed

+152
-10
lines changed

4 files changed

+152
-10
lines changed

examples/ecrh_q_optimisation/job_scripts/bezier.sbatch

+17-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
#SBATCH -J bezier
2+
#SBATCH -J BezVec
33
#SBATCH -A UKAEA-AP002-CPU
44
#SBATCH -p icelake
55
#SBATCH --output=%x_%j.out
@@ -23,27 +23,38 @@ unset OMP_NUM_THREADS
2323
# Fix CUDA error
2424
LD_LIBRARY_PATH=$CONDA_PREFIX/lib/python3.10/site-packages/nvidia/cublas/lib/:$LD_LIBRARY_PATH
2525

26+
# Parameters
27+
N_SOBOL_STEPS=1
28+
let "N_SOBOL_SAMPLES = $SLURM_CPUS_PER_TASK * $N_SOBOL_STEPS"
29+
let "N_BAYESOPT_STEPS = 8 - $N_SOBOL_STEPS"
30+
2631
# Directory structure
2732
cd /home/tab53/rds/rds-ukaea-ap002-mOlK9qn0PlQ/tab53/jetto-mobo/examples/ecrh_q_optimisation
28-
OUTPUT_DIR="data/bezier"
33+
OUTPUT_DIR=data/vector/bezier_fail0.3_batch32
2934

3035
# Save command as a variable, using 'here document' syntax
3136
read -r -d '' COMMAND <<- EOM
3237
$CONDA_PREFIX/bin/python main.py \
33-
--batch_size 30 \
34-
--initial_batch_size 30 \
35-
--n_iterations 16 \
38+
--batch_size $SLURM_CPUS_PER_TASK \
39+
--initial_batch_size $N_SOBOL_SAMPLES \
40+
--n_iterations $N_BAYESOPT_STEPS \
3641
--output_dir $OUTPUT_DIR \
3742
--parameterisation bezier \
3843
--n_parameters 10 \
39-
--alpha 0.05
44+
--jetto_fail_value 0.3 \
45+
--alpha 0.01
4046
EOM
4147

4248
# Resume if target directory exists
4349
if [ -d "$OUTPUT_DIR" ]; then
4450
COMMAND="$COMMAND --resume"
51+
else
52+
mkdir -p $OUTPUT_DIR
4553
fi
4654

55+
# Save command to file
56+
echo "$COMMAND" > $OUTPUT_DIR/command.txt
57+
4758
# Execute
4859
echo "Executing command: $COMMAND"
4960
eval $COMMAND
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/bin/bash
2+
#SBATCH -J BezVec
3+
#SBATCH -A UKAEA-AP002-CPU
4+
#SBATCH -p icelake
5+
#SBATCH --output=%x_%j.out
6+
#SBATCH --nodes=1
7+
#SBATCH --ntasks=1
8+
#SBATCH --cpus-per-task=32
9+
#SBATCH --time=24:00:00
10+
#SBATCH --mail-type=ALL
11+
12+
# Set up environment
13+
. /etc/profile.d/modules.sh
14+
module purge
15+
module load rhel8/default-icl
16+
module load miniconda/3
17+
source /home/tab53/.bashrc
18+
conda activate jetto-mobo
19+
20+
# Allow Pytorch to multithread
21+
unset OMP_NUM_THREADS
22+
23+
# Fix CUDA error
24+
LD_LIBRARY_PATH=$CONDA_PREFIX/lib/python3.10/site-packages/nvidia/cublas/lib/:$LD_LIBRARY_PATH
25+
26+
# Parameters
27+
N_SOBOL_STEPS=1
28+
let "N_SOBOL_SAMPLES = $SLURM_CPUS_PER_TASK * $N_SOBOL_STEPS"
29+
let "N_BAYESOPT_STEPS = 8 - $N_SOBOL_STEPS"
30+
31+
# Directory structure
32+
cd /home/tab53/rds/rds-ukaea-ap002-mOlK9qn0PlQ/tab53/jetto-mobo/examples/ecrh_q_optimisation
33+
OUTPUT_DIR=data/vector/bezier_sobol_batch32
34+
35+
# Save command as a variable, using 'here document' syntax
36+
read -r -d '' COMMAND <<- EOM
37+
$CONDA_PREFIX/bin/python main.py \
38+
--batch_size $SLURM_CPUS_PER_TASK \
39+
--initial_batch_size $N_SOBOL_SAMPLES \
40+
--n_iterations $N_BAYESOPT_STEPS \
41+
--output_dir $OUTPUT_DIR \
42+
--parameterisation bezier \
43+
--sobol_only \
44+
--n_parameters 10 \
45+
--discard_failures
46+
EOM
47+
48+
# Resume if target directory exists
49+
if [ -d "$OUTPUT_DIR" ]; then
50+
COMMAND="$COMMAND --resume"
51+
else
52+
mkdir -p $OUTPUT_DIR
53+
fi
54+
55+
# Save command to file
56+
echo "$COMMAND" > $OUTPUT_DIR/command.txt
57+
58+
# Execute
59+
echo "Executing command: $COMMAND"
60+
eval $COMMAND

examples/ecrh_q_optimisation/job_scripts/piecewise_linear.sbatch

+16-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
#SBATCH -J piecewise_linear
2+
#SBATCH -J PiLiVec
33
#SBATCH -A UKAEA-AP002-CPU
44
#SBATCH -p icelake
55
#SBATCH --output=%x_%j.out
@@ -23,25 +23,37 @@ unset OMP_NUM_THREADS
2323
# Fix CUDA error
2424
LD_LIBRARY_PATH=$CONDA_PREFIX/lib/python3.10/site-packages/nvidia/cublas/lib/:$LD_LIBRARY_PATH
2525

26+
# Parameters
27+
N_SOBOL_STEPS=1
28+
let "N_SOBOL_SAMPLES = $SLURM_CPUS_PER_TASK * $N_SOBOL_STEPS"
29+
let "N_BAYESOPT_STEPS = 8 - $N_SOBOL_STEPS"
30+
2631
# Directory structure
2732
cd /home/tab53/rds/rds-ukaea-ap002-mOlK9qn0PlQ/tab53/jetto-mobo/examples/ecrh_q_optimisation
28-
OUTPUT_DIR="data/piecewise_linear"
33+
OUTPUT_DIR=data/vector/piecewise_linear_fail0.3_2
2934

3035
# Save command as a variable, using 'here document' syntax
3136
read -r -d '' COMMAND <<- EOM
3237
$CONDA_PREFIX/bin/python main.py \
33-
--batch_size 30 \
34-
--initial_batch_size 30 \
38+
--batch_size $SLURM_CPUS_PER_TASK \
39+
--initial_batch_size $N_SOBOL_SAMPLES \
40+
--n_iterations $N_BAYESOPT_STEPS \
3541
--output_dir $OUTPUT_DIR \
3642
--parameterisation piecewise_linear \
43+
--jetto_fail_value 0.3 \
3744
--alpha 0.01
3845
EOM
3946

4047
# Resume if target directory exists
4148
if [ -d "$OUTPUT_DIR" ]; then
4249
COMMAND="$COMMAND --resume"
50+
else
51+
mkdir -p $OUTPUT_DIR
4352
fi
4453

54+
# Save command to file
55+
echo "$COMMAND" > $OUTPUT_DIR/command.txt
56+
4557
# Execute
4658
echo "Executing command: $COMMAND"
4759
eval $COMMAND
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/bin/bash
2+
#SBATCH -J PiLiVec
3+
#SBATCH -A UKAEA-AP002-CPU
4+
#SBATCH -p icelake
5+
#SBATCH --output=%x_%j.out
6+
#SBATCH --nodes=1
7+
#SBATCH --ntasks=1
8+
#SBATCH --cpus-per-task=32
9+
#SBATCH --time=24:00:00
10+
#SBATCH --mail-type=ALL
11+
12+
# Set up environment
13+
. /etc/profile.d/modules.sh
14+
module purge
15+
module load rhel8/default-icl
16+
module load miniconda/3
17+
source /home/tab53/.bashrc
18+
conda activate jetto-mobo
19+
20+
# Allow Pytorch to multithread
21+
unset OMP_NUM_THREADS
22+
23+
# Fix CUDA error
24+
LD_LIBRARY_PATH=$CONDA_PREFIX/lib/python3.10/site-packages/nvidia/cublas/lib/:$LD_LIBRARY_PATH
25+
26+
# Parameters
27+
N_SOBOL_STEPS=1
28+
let "N_SOBOL_SAMPLES = $SLURM_CPUS_PER_TASK * $N_SOBOL_STEPS"
29+
let "N_BAYESOPT_STEPS = 8 - $N_SOBOL_STEPS"
30+
31+
# Directory structure
32+
cd /home/tab53/rds/rds-ukaea-ap002-mOlK9qn0PlQ/tab53/jetto-mobo/examples/ecrh_q_optimisation
33+
OUTPUT_DIR=data/vector/piecewise_linear_sobol_2
34+
35+
# Save command as a variable, using 'here document' syntax
36+
read -r -d '' COMMAND <<- EOM
37+
$CONDA_PREFIX/bin/python main.py \
38+
--batch_size $SLURM_CPUS_PER_TASK \
39+
--initial_batch_size $N_SOBOL_SAMPLES \
40+
--n_iterations $N_BAYESOPT_STEPS \
41+
--output_dir $OUTPUT_DIR \
42+
--parameterisation piecewise_linear \
43+
--sobol_only \
44+
--discard_failures
45+
EOM
46+
47+
# Resume if target directory exists
48+
if [ -d "$OUTPUT_DIR" ]; then
49+
COMMAND="$COMMAND --resume"
50+
else
51+
mkdir -p $OUTPUT_DIR
52+
fi
53+
54+
# Save command to file
55+
echo "$COMMAND" > $OUTPUT_DIR/command.txt
56+
57+
# Execute
58+
echo "Executing command: $COMMAND"
59+
eval $COMMAND

0 commit comments

Comments
 (0)