Relative Content

Tag Archive for arraysjobsslurmsbatch

Using slurm array jobs

I have a jobscript that runs a certain python script with arguments provided with argparsing. I know that when I want to run this job, I will almost always want to submit not just one job, but several in parallel with different values of one particular argument. I have read several articles on using slurm arrays for this, by setting for instance:
#SBATCH --array=1-10 at the top of the jobscript, and then accessing the values of the array using $SLURM_ARRAY_TASK_ID in the call the python script. However, I can’t seem to find a way to make the array run over any arbitrary array of numbers. For a concrete example, say I would like to use the values [0.1, 0.75, 3, 25.5, 50]. The numbers can always be increasing, but aren’t necessarily related mathematically in any other way. I know I could write a separate file and read these values in based on the row number of that file, but that seems like overkill.