Home > Blockchain >  start a SBATCH array with big number?
start a SBATCH array with big number?

Time:10-13

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 ?

CodePudding user response:

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

CodePudding user response:

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]}
...
  • Related