Skip to content

Instantly share code, notes, and snippets.

@mxxo
Last active November 4, 2021 23:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mxxo/35d788576e5960c6f62d94ec048d5e91 to your computer and use it in GitHub Desktop.
Save mxxo/35d788576e5960c6f62d94ec048d5e91 to your computer and use it in GitHub Desktop.
Slurm script for running EGSnrc user codes as a job array
#!/bin/bash
# SLURM_ARRAY_TASK_ID will range from 1 to 10
#SBATCH --array=1-10
# adjust time limits as needed
#SBATCH --time=02:00:00
# run the user code using the input.egsinp file on ten cores
# note: * each run will use a different set of initial random numbers
# * the -s flag forces EGSnrc to use a simple job control object (no locking)
user_code -i input.egsinp -p pegs_data.pegs4dat -b -P 10 -j $SLURM_ARRAY_TASK_ID -s
# this will result in 10 egsdat files, which must be combined manually afterwards
# using calculation=combine in the input file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment