diff --git a/render/job.sh b/render/job.sh new file mode 100644 index 0000000..ea6011a --- /dev/null +++ b/render/job.sh @@ -0,0 +1,16 @@ +#!/bin/bash -l +#SBATCH -J rose +#SBATCH -o /path/to/rose/states/rose.out +#SBATCH -e /path/to/rose/states/rose.err +#SBATCH --mail-type=ALL +#SBATCH --mail-user=rose-slurm@unkaktus.art +#SBATCH --ntasks=21 +#SBATCH --nodes=3 +#SBATCH --ntasks-per-node=7 +#SBATCH --time=48:00:00 + +source /home/SPACK2023/share/spack/setup-env.sh +module load apptainer-1.0.3-gcc-12.2.0-aojy6ca + +cd /path/to/rose +srun -n 21 ./render.sh states/state.pvsm \ No newline at end of file diff --git a/render/render.sh b/render/render.sh new file mode 100644 index 0000000..d7e877a --- /dev/null +++ b/render/render.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# This script is to be called from the batch job, +# so that Slurm environment variables are set after scheduling. + +STATE_NAME=${1%.*} +TOTAL_TASK_NUMBER=21 +echo "State name: $STATE_NAME" +mkdir -p "$STATE_NAME" + +apptainer exec --bind /scratch:/scratch \ + /path/to/rose.sif render_state.py \ + --state=$1 \ + --total-task-number=$TOTAL_TASK_NUMBER \ + --task-id=$(($SLURM_NODEID*$SLURM_NTASKS_PER_NODE + $SLURM_LOCALID)) \ + --output-dir=$STATE_NAME \ No newline at end of file diff --git a/render_state.py b/render/render_state.py similarity index 100% rename from render_state.py rename to render/render_state.py