Managing Batch Jobs

This page is under construction! We cannot guarantee completion or accuracy of information herein while in development.

Overview

It may be helpful to get information about queued, running, or past jobs. There are several functionalities within Slurm that can help with this process. Note that all of the following commands are contextual to the current cluster. To view commands on a different cluster, type the name of that cluster, and then run the command. 

Queued & Running Jobs

To see jobs that are in the queue or currently running on the current cluster, use squeue --user $USER. Note that this command will not show jobs that have finished via completion, cancellation, or any other reason. 

Previous Jobs

Users may want to review details of past jobs, or to study their performance to improve future jobs. The following commands may help:

  • past-jobs
  • job-history
  • seff

SLURM and System Commands

Additional helpful commands are included here. For a complete list of Slurm commands and options, please refer to the official Slurm documentation.

CommandPurposeExample(s)
Native Slurm Commands
sbatchSubmits a batch script for executionsbatch script.slurm
srunRun parallel jobs. Can be in place of mpirun/mpiexec. Can be used interactively as well as in batch scriptssrun -n 1 --mpi=pmi2 a.out
sallocRequests a session to  work on a compute node interactivelysee: Interactive Jobs
squeueChecks the status of pending and running jobs

squeue --job $JOBID
squeue --user $NETID

scancelCancel a running or pending job

scancel $JOBID
scancel -u $NETID

scontrol holdPlace a hold on a job to prevent it from being executedscontrol hold $JOBID
scontrol releaseReleases a hold placed on a job allowing it to be executedscontrol release $JOBID
System Commands
vaDisplays your group membership, your account usage, and CPU allocation. Short for "view allocation"va
interactiveShortcut for quickly requesting an interactive job. Use "interactive --help" to get full usage. interactive -a $GROUP_NAME
job-historyRetrieves a running or completed job's history in a user-friendly formatjob-history $JOBID
seffRetrieves a completed job's memory and CPU efficiencyseff $JOBID
past-jobsRetrieves past jobs run by user. Can be used with option "-d N" to search for jobs run in the past N days.past-jobs -d 5
job-limitsView your group's job resource limits and current usage.job-limits $GROUP
nodes-busyDisplay a visualization of nodes on a cluster and their usagenodes-busy --help
system-busyDisplay a text-based summary of a cluster's usagesystem-busy
cluster-busyDisplay a visualization of all three cluster's overall usagecluster-busy --help