Job arrays
This article is a draft
This is not a complete article: This is a draft, a work in progress that is intended to be published into an article, which may or may not be ready for inclusion in the main wiki. It should not necessarily be considered factual or authoritative.
Also known as a task array or an array job, a job array is a way to submit a whole set of jobs with one command. The individual jobs in the array are distinguished by an environment variable, $SLURM_ARRAY_TASK_ID
, which is set to a different value for each instance of the job.
sbatch --array=0-7 ... # $SLURM_ARRAY_TASK_ID will take values from 0 to 7 inclusive sbatch --array=1,3,5,7 ... # $SLURM_ARRAY_TASK_ID will take the listed values sbatch --array=1-7:2 ... # Step-size of 2, does the same as the previous example sbatch --array=1-100%10 ... # Allow no more than 10 of the jobs to run simultaneously
See Job Array Support at SchedMD.com for detailed documentation.