Topics Map > User Guides
Topics Map > Platform R

Platform R: Useful Slurm Commands

This document covers a selection of Slurm commands which most people will use frequently. All of them have more advanced capabilities, for which you should see the offical Slurm documentation.

All of the commands that ask the Slurm system for information can take a -o (or --format) argument to customize the output. If you have a particular set of values you prefer to see over the defaults, most commands have an environment variable you can set.

You can also use the --json option to get JSON formatted output.

sinfo

This command gives a summary of the nodes and partitions available in the Slurm cluster. The default output can be challenging to read, but this format option produces a briefer report: sinfo -o "%9P %5D %30b %G"

The "partition" column shows the Platform R partitions. The "shared" partition is the default partition which nearly everyone will use. The "nodes" column shows how many computers there are in the cluster that match the rest of that line's description. The "active features" column shows more detailed CPU features, which can be selected with constraints (see Platform R: Slurm Constraints for using constraints). Finally, the GRES column shows if those nodes have GPUs, and of what type.

To see currently unused nodes: sinfo --states=idle --partition=shared 

Also see the sinfo manual page.

sbatch

The sbatch command submits jobs to the Slurm scheduler for processing. See Platform R: Slurm Introduction for local examples of use.

Also see the sbatch manual page.

srun

The srun command operates in two contexts:

  1. at the command line, to connect directly to computational resources
  2. from within a batch script to start job steps

See Platform R: Slurm Introduction for local examples of use.

Also see the srun manual page.

squeue

This shows what jobs are currently in the Slurm queue, and what their status is. To see just your own jobs, use squeue --me. See Platform R: Debugging Slurm Jobs for a list of job states.

Also see the squeue maual page.

scancel

The scancel command ends jobs. 

Scancel Examples
Command Meaning
scancel 2345 cancel job by Job ID
scancel 2345_2 scancel array ID 2 of job 2345
scancel --me cancel all jobs owned by me

Also see the scancel manual page.

scontrol

The scontrol command is used to get detailed information about a running job, as well as to make changes to job priority. Use squeue to get a JobID.

Useful scontrol Options.
Options Meaning
scontrol show job <JobID> get very detailed information about a queued job
scontrol hold <JobID> prevent a pending job from starting
scontrol release <JobID> releases a held, pending job to begin execution
scontrol top <JobID> places one of your jobs ahead of all your other jobs

Also see the scontrol manual page.

sacct

This command gives information about completed jobs. It can give some information about currently running jobs, but sstat is the better tool for checking on running jobs.

Sacct Examples
Options Meaning
sacct with no options, returns information on all jobs run since midnight 
sacct --starttime=now-7days report on all jobs for the last week
sacct --starttime=1015 --endtime=1020 report on all jobs between October 15th and 20th
sacct --state=FAILED report on all jobs run since midnight which failed; see Platform R: Debugging Slurm Jobs for a list of job states

Times for --starttime and --endtime can be represented in several ways:

  • the time words today, midnight, noon, now
  • time formats, with optional elements in square brackets:
    • HH:MM[:SS][AM|PM]
    • MMDD[YY][-HH:MM[:SS]]
    • MM.DD[-HH:MM[:SS]]
    • MM/DD[-HH:MM[:SS]]
    • YYYY-MM-DD

Any time can be modified by adding or subtracting seconds, minutes, hours, days, weeks, such as now+2weeks for two weeks from now. The time units have to be spelled out fully, so you cannot use 2d for two days.

Also see the sacct manual page.

sstat

The sstat command gives detailed information about currently running jobs. Unlike sacct, which will give information about whatever happens to have been in the queue recently if you don't specify a Job ID, sstat must have a Job ID argument: sstat -j <JobID>

Also see the sstat manual page.

Other Resources



Keywords:
slurm, platform r
Doc ID:
157151
Owned by:
William A. in SMPH Research Applications
Created:
2025-12-09
Updated:
2026-03-24
Sites:
SMPH Research Applications