LinuxCommandLibrary

squeue

Display status of queued jobs

TLDR

View the queue

$ squeue
copy

View jobs queued by a specific user
$ squeue [[-u|--user]] [username]
copy

View the queue and refresh every 5 seconds
$ squeue [[-i|--iterate]] [5]
copy

View the queue with expected start times
$ squeue --start
copy

SYNOPSIS

squeue [OPTIONS]

PARAMETERS

-a, --all
    Show all jobs. This option often includes jobs that are not normally displayed, such as system jobs, or may override default filters.

-h, --help
    Display a brief help message and exit.

-i, --iterate=
    Repeat job status display every seconds seconds.

-j, --jobs=
    Display information only for the specified job(s) by ID.

-l, --long
    Display information in a long format, providing more details about each job.

-o, --format=
    Define the output format using a special string. This allows users to customize which fields are shown.

-p, --partition=
    Filter jobs by a comma-separated list of partition names.

-s, --slim
    Display information in a compact, slim format, showing fewer columns.

-t, --state=
    Filter jobs by a comma-separated list of job states (e.g., PENDING, RUNNING, COMPLETED, CANCELLED).

-u, --user=
    Filter jobs by a comma-separated list of user names or user IDs.

-M, --clusters=
    Show jobs from the specified cluster(s) in a federated Slurm environment.

-N, --nodes
    Display the node names associated with each job.

DESCRIPTION

The squeue command is an integral part of the Slurm Workload Manager, a highly scalable and fault-tolerant open-source job scheduler for Linux clusters. Its primary function is to display information about jobs or job steps that are currently held in the Slurm queue. This includes jobs that are PENDING (waiting to be scheduled), RUNNING (actively executing), COMPLETING (finishing up), or in other states.

Users frequently employ squeue to monitor the status and progress of their own submitted jobs, while system administrators use it to get an overall picture of cluster utilization and job backlog. The output typically includes details such as job ID, partition, name, user, state, time limit, elapsed time, and the nodes allocated. It is an indispensable tool for managing and understanding the current workload on a Slurm-managed cluster.

CAVEATS

`squeue` primarily shows jobs that are currently active or in the queue. For detailed accounting information on completed or failed jobs, the sacct command is typically used. The output can be extensive on large, busy clusters, requiring filtering options for readability. Users can generally only view their own jobs unless they have specific administrative privileges.

COMMON JOB STATES

Understanding job states is crucial when using squeue. Some common states include:
PENDING (PD): Job is waiting for resources.
RUNNING (R): Job is currently executing.
COMPLETING (CG): Job is finishing up, but some processes might still be running.
COMPLETED (CD): Job finished successfully.
FAILED (F): Job terminated with a non-zero exit code or an error.
CANCELLED (CA): Job was cancelled by the user or administrator.
SUSPENDED (S): Job execution has been temporarily stopped.

CUSTOM OUTPUT FORMATTING

The -o or --format option is powerful for tailoring squeue output. It allows users to specify exactly which fields to display and in what order using format codes (e.g., %i for Job ID, %u for User, %T for State). This is particularly useful for scripting or when a specific set of information is required.

HISTORY

squeue is a fundamental utility within the Slurm Workload Manager, which was originally developed at Lawrence Livermore National Laboratory and released in 2002. As Slurm evolved into one of the most widely used open-source schedulers for high-performance computing (HPC) clusters, squeue remained a core component, constantly updated to reflect new Slurm features and improve its functionality and output options.

SEE ALSO

sbatch(1), srun(1), scancel(1), sinfo(1), sacct(1), sstat(1)

Copied to clipboard