Workload Managers Quick Reference
F.1 Slurm
Slurm is a GPL-licensed workload management system and developed largely at Lawrence Livermore National Laboratory. The name was originally an acronym for Simple Linux Utility for Resource Management, but the acronym is deprecated because it no longer does justice to the advanced capabilities of Slurm.
The Slurm service and outputs are normally handled using the Base View or cmsh front end tools for CMDaemon (section 7.4).
From the command line, direct Slurm commands that may sometimes come in useful include the following:
-
sacct: used to report job or job step accounting information about active or completed jobs.Example
-
salloc: used to allocate resources for a job in real time. Typically this is used to allocate resources and spawn a shell. The shell is then used to execute srun commands to launch parallel tasks. -
sattachused to attach standard input, output, and error plus signal capabilities to a currently running job or job step. One can attach to and detach from jobs multiple times. -
sbatch: used to submit a job script for later execution. The script typically contains one or more srun commands to launch parallel tasks. -
sbcast: used to transfer a file from local disk to local disk on the nodes allocated to a job. This can be used to effectively use diskless compute nodes or provide improved performance relative to a shared filesystem. -
scancel: used to cancel a pending or running job or job step. It can also be used to send an arbitrary signal to all processes associated with a running job or job step. -
scontrol: the administrative tool used to view and/or modify Slurm state. Note that many scontrol commands can only be executed as user root.Example
If a node, for example
node001, is stuck in aCGstate (“completing”), and rebooting it is not feasible, then the following may clear it in some cases:Example
-
sinfo: reports the state of partitions and nodes managed by Slurm. It has a wide variety of filtering, sorting, and formatting options.Example
-
smap: reports state information for jobs, partitions, and nodes managed by Slurm, but graphically displays the information to reflect network topology. -
squeue: reports the state of jobs or job steps. It has a wide variety of filtering, sorting, and formatting options. By default, it reports the running jobs in priority order and then the pending jobs in priority order.Example
-
srun: used to submit a job for execution or initiate job steps in real time. srun has a wide variety of options to specify resource requirements, including: minimum and maximum node count, processor count, specific nodes to use or not use, and specific node characteristics (so much memory, disk space, certain required features, etc.). A job can contain multiple job steps executing sequentially or in parallel on independent or shared nodes within the job’s node allocation.Auto Scaler dynamic node issues with
srun: A concern aboutsrun(https://bugs.schedmd.com/show_bug.cgi?id=1333) at the time of writing (January 2023) is the following: After ansrunjob has been queued, and a new node is added, theslurm.conffile is not read again. This means that the new node resource is not seen by jobs usingsrun. Thus, withsrunjobs, nodes launched dynamically by Auto Scaler remain unused, and can fail. Workarounds are to usesallocorsbatchinstead ofsrun. -
smap: reports state information for jobs, partitions, and nodes managed by Slurm, but graphically displays the information to reflect network topology. -
strigger: used to set, get or view event triggers. Event triggers include things such as nodes going down or jobs approaching their time limit. -
sview: a graphical user interface to get and update state information for jobs, partitions, and nodes managed by Slurm.
There are man pages for these commands. Full documentation on Slurm is available online at: http://slurm.schedmd.com/documentation.html.