...
Slurm offers a lot of options for job allocation, process placement, job dependencies and arrays and much more. We cannot exhaustively cover all topics here. As mentioned at the top of the page, please consult the official slurm documentation and the man pages for an in depth description of all parameters.
+48 Hour Jobs & beyond
Most Slurm partitions CPU We prefer short job times and enable +48h jobs only as a last resort. Minimal walltimes have several advantages regarding efficient queuing (backfilling). If all jobs were +48h, two days before each maintenance our machine would be empty...
Most Slurm partition CPU CLX have a maximal wall time of 12 hours. In contrast, 48 hours is offered per default by all shared partitions, all grete partitions and medium40, large40 of Emmy.
During normal office hours, one can request the extension of the wall time of any running job (mail with your user and job ID to support[at]hlrn support@nhr.zib.de). Alternatively - also per mail request (including user and project ID) - permanent access to run 48h jobs on all partitions of Lise and/or Emmy can be granted (and be used by adding e.g. #SBATCH -q 48h
). Other Quality of Service levels for even longer runtimes can also be requested, but have additional restrictions regarding job size (number of nodes).
However, we recommend permanent access to the loing long running QoS only as a last resort. We do not guarantee to refund your NPL compute time on the long running QoS if something fails. Before, you You should exploit all possibilities to parallelize/speed up your code or make it restartable (see also below), first.
Dependent & Restartable Jobs - How to pass the wall time limit
If your simulation is restartable, it might be handy to automatically trigger a follow-up job. Simply provide the ID of the previous job as an additional sbatch argument:
...
Please note: As soon as a follow-up jobscript (sbatch file) is submitted, you can not change its content any more. Lines starting with #SBATCH will be evaluated immediately. The remaining content of the jobscript is evaluated as soon as the dependency condition is fulfilled and compute nodes are available. Besides afterok
there exist other dependency types (sbatch man page).
Job Arrays
Job arrays are the preferred way to submit many similar job. Jobs, for instance, if you need to run the same program on a number of input files, or with different settings or run them with a range of parameters. Arrays are created with the -a start-finish
sbatch parameter. E.g. sbatch -a 0-19
will create 20 jobs indexed from 0 to 19. There are different ways to index the arrays, which are described below.
The behavior of the jobs can then be tied to Slurm Environment variables, which tell the program, which part of the array they are.
Job Array Indexing, Stepsize and more
Slurm supports a number of ways to set up the indexing in job arrays.
...
You can read everything on array indexing in the sbatch man page.
Slurm Array Environment Variables
The most used environment variable in Slurm arrays is $SLURM_ARRAY_TASK_ID
. This contains the index of the job in the array and is different in every Job of the array. Other variables are:
Kein Format | ||
---|---|---|
| ||
SLURM_ARRAY_TASK_COUNT Total number of tasks in a array. SLURM_ARRAY_TASK_ID Job array ID (index) number. SLURM_ARRAY_TASK_MAX Job array's maximum ID (index) number. SLURM_ARRAY_TASK_MIN Job array's minimum ID (index) number. SLURM_ARRAY_TASK_STEP Job array's index step size. SLURM_ARRAY_JOB_ID Job array's master job ID number. |
Example Job Array
This is an example of a a job array, creates a job for every file ending in “.inp” in the current workding directory
...