Slurm Commands
A list of useful Slurm commands can be found below.
If HPC users would like more information, a very useful Slurm sbatch
Guide can be found here and a Slurm full documentation can also be found at here.
Command | Description | Usage Example | Effect |
---|---|---|---|
|
Submit a job | sbatch myjob |
Submits the job “myjob” for the execution. |
|
Show status of batch jobs | squeue -u bellj |
Show the status of all the jobs submitted by the user bellj (Jason Bell). |
|
Delete a job | scancel 3221 |
Deletes the job with job id 3221. |
|
Place a hold on a job to keep it from being scheduled for running | scontrol hold 54 |
Puts the user hold on job 54. |
|
Append a message to the output of an executing job | scontrol update JobId=12345 Comment="This is a job message" |
Writes the message to the squeue job info |
|
Terminate an executing job and return it to a queue | scontrol requeue 54 |
Terminates the running job 54 and returns it into the queue. |
|
Remove a hold from a job | scontrol release 54 |
Releases the user type hold from the job 54. |
|
Send a signal to an existing job | scontrol signal SIGTERM jobid=12345 |
This command would send terminate signal to the job 12345 |
Job identifiers, queue names, Slurm server names or named queues on named servers can be given as additional operands for these options. These restrict displayed information only to these items. For more information about these operands and the scontrol command see the manual page here.
Delete all current running jobs
scancel -u [user]
Job status Job status is displayed by the command squeue without options, or in an alternative format by using, e.g. the options -a, -i, -r, -n and -u without -f. When option -f is included, full job status, i.e., attributes including requested and used (if job is running) resources, is displayed.
squeue -o "%.18i %.9P %.100j %.8u %.2t %.10M %.6D %.8C %.8m" | column -t
The above example will return the below information formatted:
JOBID PARTITION NAME USER ST TIME NODES CPUS MIN_MEMO
541 workq 12345 decostal R 4:09 1 2 1G