start a SBATCH array with big number?

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 ?

2 answers

  • answered 2021-10-13 07:37 ciaron

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

  • answered 2021-10-13 10:57 damienfrancois

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

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum