1

Is it possible to start a SBATCH job array, i.e. #SBATCH ––array=1-5, with a big number, e.g. #SBATCH ––array=12-25 ?

fslack
  • 189
  • 9

2 Answers2

3

You can start at a value larger than 1, but the values must remain below the MaxArraySize value configure in slurm.conf.

Otherwise, you will get an error:

$ scontrol show config | grep -i array
MaxArraySize            = 1001
$ sbatch --array 1000-1005 --wrap hostname
sbatch: error: Batch job submission failed: Invalid job array specification

Should that be the case, you can use a Bash array to hold the values and then use SLURM_ARRAY_TASK_ID as index into that array:

...
#SBATCH --array=0-5
...
VALUES=({1000..1005})
THISJOBVALUE=${VALUES[$SLURM_TASK_ARRAY_ID]}
...
damienfrancois
  • 52,978
  • 9
  • 96
  • 110
0

Yes. Have you tried already? See man sbatch under -a, --array.

ciaron
  • 1,089
  • 7
  • 15