Slurm: the HPC workload manager
How Slurm allocates nodes, queues jobs and launches parallel work, with the daemons, entities and commands the exam expects.
- Describe AI cluster orchestration and job scheduling essentials.
Slurm is an open-source, fault-tolerant and highly scalable cluster manager and job scheduler for Linux, used on most of the world’s supercomputers and on many DGX clusters. It needs no kernel changes. SchedMD lists its three key functions:
- Allocate exclusive or shared access to compute nodes for a period of time.
- Provide a framework to start, execute and monitor parallel work (such as a multi-node training job) on those nodes.
- Arbitrate contention by managing a queue of pending work.
01The daemons
| Daemon | Runs on | Job |
|---|---|---|
| slurmctld | Management node (optional backup) | The brain: tracks resources and jobs, schedules |
| slurmd | Every compute node | Waits for work, runs it, reports status |
| slurmdbd | Database node (optional) | Accounting for one or more clusters in one database |
| slurmrestd | Optional | REST API for Slurm |
02The entities
- Node: a compute server, with attributes such as CPUs, memory, features and state (IDLE, ALLOCATED, DOWN, DRAINED).
- Partition: a named group of nodes that acts as a queue, with limits such as maximum run time, node count, allowed groups and priority. Partitions can overlap.
- Job: an allocation of resources to a user for a time.
- Job step: a set of (possibly parallel) tasks within a job; several steps can run inside one allocation.
- GRES (generic resources): how Slurm tracks GPUs and other devices on a node.
03Commands
| Command | Use |
|---|---|
sbatch | Submit a batch script to the queue |
srun | Launch a job or a job step (parallel tasks) |
squeue | See pending and running jobs |
sinfo | See partitions and node states |
scancel | Cancel a job |
sacct | Accounting for running and completed jobs |
scontrol | Admin: view and change configuration and state (e.g. drain a node) |
sacctmgr | Admin: manage accounts, users and limits |
#!/bin/bash
#SBATCH --job-name=llm-train
#SBATCH --partition=train
#SBATCH --nodes=4 # 4 DGX nodes
#SBATCH --gres=gpu:8 # 8 GPUs per node via GRES
#SBATCH --ntasks-per-node=8 # one task per GPU
#SBATCH --time=48:00:00
srun python train.py --config llama.yaml
sbatch train.sh # → Submitted batch job 4182
squeue -u $USER # is it pending or running?
sinfo -p train # how many nodes are idle?
scancel 4182
04Plugins that matter for AI
Slurm is built from plugins: scheduling (including backfill), priority (multifactor: age, fair share, size, QoS), preemption, gang scheduling, topology-aware placement (keep a job under the same switches), GRES for GPUs, MPI and container support. On NVIDIA clusters Slurm works with DCGM to avoid unhealthy GPUs, and jobs use NCCL and GPUDirect RDMA across nodes. Base Command Manager can install and manage Slurm for you.
✦Key terms: flip the cards
- Daemons: slurmctld (brain), slurmd (nodes), slurmdbd (accounting).
- Partitions are queues; GPUs requested with GRES.
- Commands: sbatch, srun, squeue, sinfo, scancel, sacct, scontrol.
- sbatch submits a script; srun launches tasks (often inside the script).
- slurmdbd is accounting, not the scheduler.
?Quick quiz
1. Which daemon is the central Slurm scheduler?
Why: slurmctld is the controller.
2. How do you request 8 GPUs per node in a Slurm script?
Why: GPUs are generic resources (GRES).
3. What is a Slurm partition?
Why: Partitions group nodes and set queue limits.
4. Which command shows the state of nodes and partitions?
Why: sinfo reports partitions and node states.
Score: 0 / 4
This lesson explains the reading in plain language and adds the exam context around it. Read the original too: it is short, and seeing the vendor wording helps on exam day.