Slurm Scheduler Basics
Slurm is a cluster management and job scheduling system for Linux clusters. As a cluster workload manager, Slurm has three key functions.
- Allocates user access to computing resources for some duration of time
- Provides a framework for starting, executing, and monitoring jobs
- Manages resource contention by managing and scheduling pending jobs
Some Slurm commands
Detailed explanations about these commands are
provided elsewhere on this
site. You can also get info by checking the manual pages (ie: man
<s-command>).
sacct
Report job accounting information about active or completed jobs. Useful to see account billing for your past jobs as well as to check the memory usage.
Example
sacct -S 2024-08-15 -o JobID%20,Start,Elapsed,State,AveRSS,MaxRSS,AllocTRES%48
The MaxRSS column shows the high water mark of memory used by your job.
Use this information to limit requesting excessive memory. The billing=
number times the Elapsed time in hours is the SU charged against
your slurm account.
See the section on sacct command in the utilities knowledge base page for more information.
salloc
Allocate resources for an interactive job. You can use command line options to request resources and provide a command to execute (spawn a shell).
sbatch
Used to submit a job script to the scheduler. The script
usually contains #SBATCH directives to request resources and one or more
commands to execute the job.
Example
sbatch my_job_script.sh
This command is discussed in greater detail in the knowledge base article on job submission.
scancel
Used to cancel a pending or running job. Example: To cancel JobID 13422
Example
scancel 13422
See the section on scancel command in the utilities knowledge base page for more information.
scontrol
An administrative tool to view or modify jobs. Many modification options are only available to the systems staff. Examples:
Example
scontrol show job 13422
See the section on scontrol command in the utilities knowledge base page for more information.
sinfo
Reports the state of partitions and nodes managed by Slurm.
Example
sinfo
sinfo -o "%40N %10c %10m %35f %25G"
See the section on sinfo command in the utilities knowledge base page for more information.
squeue
Reports the running and pending jobs.
Example
squeue
squeue --me
See the section on squeue command in the utilities knowledge base page for more information.
srun
Used to submit a job for execution or initiate job steps in real time. Many command-line arguments are available to specify the required resources.