forked from maxencefaldor/Leniabreeder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsubmit.sh
48 lines (40 loc) · 1.18 KB
/
submit.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
#!/bin/bash
#SBATCH --job-name=leniabreeder
#SBATCH --output=leniabreeder_%A_%a.out
#SBATCH --error=leniabreeder_%A_%a.err
#SBATCH --time=04:30:00
#SBATCH --partition=gpu-a100-q
#SBATCH --gres=gpu:a100:1
#SBATCH --cpus-per-task=4
#SBATCH --mem=64G
#SBATCH --array=1
# Load required modules
module purge
module load apptainer/1.1.9
module load cuda12.4/toolkit/12.4.1
module load cudnn9.3-cuda12.4/9.3.0.75
# Set up environment variables
export PYTHONPATH="${PYTHONPATH}:${PWD}"
# Create working directory
WORKDIR="run_${SLURM_ARRAY_JOB_ID}_${SLURM_ARRAY_TASK_ID}"
mkdir -p ${WORKDIR}
cd ${WORKDIR}
# Build container with conda base
cd ../apptainer
APPTAINER_NOHTTPS=1 apptainer build --force ../leniabreeder.sif container.def
cd ../${WORKDIR}
# Run the experiment
apptainer run --nv \
--env CUDA_VISIBLE_DEVICES=$CUDA_VISIBLE_DEVICES \
--bind ${PWD}:/workspace/run \
--bind ${HOME}/Leniabreeder:/workspace/leniabreeder \
../leniabreeder.sif \
qd=aurora
# Copy results if needed
mkdir -p ../results/${SLURM_ARRAY_JOB_ID}_${SLURM_ARRAY_TASK_ID}
if [ -d "output" ]; then
cp -r output/* ../results/${SLURM_ARRAY_JOB_ID}_${SLURM_ARRAY_TASK_ID}/
fi
# Clean up
cd ..
rm -rf ${WORKDIR}