This page contains all important information about the batch system Slurm, that you will need to run software on the HLRN. It does not contain every feature that Slurm has to offer. For that, please consult the official documentation and the man pages.
Submission of jobs mainly happens via the sbatch
command using jobscript, but interactive jobs and node allocations are also possible using srun
or salloc
. Resource selecttion (e.g. number of nodes or cores) is handled via command parameters, or may be specified in the job script.
Partitions
To match your job requirements to the hardware you can choose among various partitions. Each partition has its own job queue. All available partitions and their corresponding walltime, core number, memory, CPU/GPU types are listed here.
Parameters
Parameter | SBATCH flag | Comment |
---|---|---|
# nodes | -N <#> | |
# tasks | -n <#> | |
# tasks per node | #SBATCH --tasks-per-node <#> | Different defaults between mpirun and srun |
partition | -p <name> | standard96 (Lise), medium40 (Emmy) |
# cores per task | -c <#> | Default 1, interesting for OpenMP/Hybrid jobs |
Wall time limit | -t hh:mm:ss | |
--mail-type=ALL | See sbatch manpage for different types | |
Project/Account | -A <project> | Specify project for NPL accounting |
Job Scripts
A job script can be any script that contains special instruction for Slurm. Most commonly used forms are shell scripts, such as bash
or plain sh
. But other scripting languages (e.g. Python, Perl, R) are also possible.
#!/bin/bash #SBATCH -p medium40 #SBATCH -N 16 #SBATCH -t 06:00:00 module load impi srun mybinary
The job scripts have to have a shebang line at the top, followed by the #SBATCH
options. These #SBATCH
comments have to be at the top, as Slurm stops scanning for them after the first non-comment non-whitespace line (e.g. an echo
or variable declaration).
More examples can be found at Examples and Recipes.
Important slurm commands
The commands normally used for job control and management are
- Job submission:
sbatch <jobscript>
srun <arguments> <command>
- Job status of a specific job:
squeue -j jobID
for queues/running jobs$ scontrol show job jobID
for full job information (even after the job finished).
- Job cancellation:
scancel jobID
scancel -i -u $USER
cancel all your jobs (-u $USER
) but ask for every job (-i
)scancel -9
send killSIGKILL
instead ofSIGTERM
- Job overview:
$ squeue -l --me
- Job start (estimated):
squeue --start -j jobID
- Workload overview of the whole system:
sinfo
(esp.sinfo --format="%25C %A"
) ,squeue -l
Using the Shared Nodes
We provide a varying number of nodes from the large40 and large96 partitions as post processeing nodes in a shared mode, so that multiple jobs can run at once on a single node. You can request CPUs and memory and should take care, that you do not exceed your limits. For each CPU/Hyperthread, there is about 9.6Gb of Memory on large40:shared or 4 on the large96:shared partition.
The maximum walltime on the shared partitions is currently 2 days.
Advanced Options
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 documentation and the man pages for an in depth description of all parameters.
Job Arrays
If you need to submit a large number of similar jobs, please do use for loops to submet them, but instead use job arrays (this lessens the burden on the scheduler). Arrays can be defined using the -a <number of jobs>
option. To divide your workload on to the different jobs within your jobscript, there are several environment variables that can be used: