Skip to content

cacct - View Job Accounting Information

cacct displays accounting information for jobs and steps in the cluster. It queries all job states, including completed, failed, and cancelled jobs. The output automatically includes jobs and their associated steps.

View all jobs and steps in the cluster:

cacct

Options

-h, --help

Applies to: Job, Step
Display help information for the cacct command.

-v, --version

Applies to: Job, Step
Display cacct version information.

-C, --config=<path>

Applies to: Job, Step
Configuration file path. Default: "/etc/crane/config.yaml".

-j, --job=<jobid1,jobid2,...>

Applies to: Job, Step
Specify job IDs to query (comma-separated list). For example, -j=2,3,4. When querying jobs, results will be filtered by job ID. The output will include matching jobs and their associated steps. Supports using job step ID format jobid.stepid to query specific steps.

-n, --name=<name1,name2,...>

Applies to: Job, Step
Specify job names to query (comma-separated list for multiple names).

-u, --user=<username1,username2,...>

Applies to: Job, Step
Specify users to query (comma-separated list for multiple users). Filter jobs and steps by the specified usernames.

-A, --account=<account1,account2,...>

Applies to: Job, Step
Specify accounts to query (comma-separated list for multiple accounts). Filter jobs and steps by the specified accounts.

-p, --partition=<partition1,partition2,...>

Applies to: Job, Step
Specify partitions to view (comma-separated list for multiple partitions). Default: all partitions.

-q, --qos=<qos1,qos2,...>

Applies to: Job, Step
Specify QoS to view (comma-separated list for multiple QoS). Default: all QoS levels.

-t, --state=<state>

Applies to: Job, Step
Specify job state to view. Supported states: 'pending' or 'p', 'running' or 'r', 'completed' or 'c', 'failed' or 'f', 'cancelled' or 'x', 'time-limit-exceeded' or 't', and 'all'. Default: 'all'. Multiple states can be specified as a comma-separated list.

-s, --submit-time=<time_range>

Applies to: Job, Step
Filter jobs by submit time range. Supports closed intervals (format: 2024-01-02T15:04:05~2024-01-11T11:12:41) or half-open intervals (format: 2024-01-02T15:04:05~ for after a specific time, or ~2024-01-11T11:12:41 for before a specific time).

-S, --start-time=<time_range>

Applies to: Job, Step
Filter jobs by start time range. Format same as submit-time.

-E, --end-time=<time_range>

Applies to: Job, Step
Filter jobs by end time range. Format same as submit-time. For example, ~2023-03-14T10:00:00 filters jobs that ended before the specified time.

-w, --nodelist=<node1,node2,...>

Applies to: Job, Step
Specify node names to view (comma-separated list or pattern such as node[1-10]). Default: all nodes.

--type=<type1,type2,...>

Applies to: Job, Step
Specify task types to view (comma-separated list). Valid values: 'Interactive', 'Batch', 'Container'. Default: all types.

-F, --full

Applies to: Job, Step
Display full information without truncating fields. By default, each cell displays only 30 characters.

-N, --noheader

Applies to: Job, Step
Hide table header in output.

-m, --max-lines=<number>

Applies to: Job, Step
Specify the maximum number of output results. For example, -m=500 limits output to 500 lines. Default: 100 lines.

--json

Applies to: Job, Step
Output command execution results in JSON format instead of table format.

-o, --format=<format_string>

Applies to: Job, Step
Customize output format using format specifiers. Fields are identified by a percent sign (%) followed by a character or string. Format specification syntax: %[.]<size><type>. Without size: field uses natural width. With size only (%5j): minimum width, left-aligned. With dot and size (%.5j): minimum width, right-aligned. See the Format Specifiers section below for available format identifiers.

Default Output Fields

When displaying default format, the following fields are shown:

  • JobId: Job or job step identifier (format: jobid for jobs, jobid.stepid for steps)
  • JobName: Job or job step name
  • Partition: Partition where job/job step runs
  • Account: Account billed for job/job step
  • AllocCPUs: Number of allocated CPUs
  • State: Job/job step state (e.g., COMPLETED, FAILED, CANCELLED)
  • ExitCode: Exit code (format: exitcode:signal, see Exit Code Reference)

Format Specifiers

The following format identifiers are supported (case-insensitive):

Identifier Description
%a / %Account Account associated with job/job step
%C / %ReqCpus Number of requested CPUs
%c / %AllocCpus Number of allocated CPUs
%D / %ElapsedTime Elapsed time since job/job step started
%E / %EndTime End time of job/job step
%e / %ExitCode Exit code (format: exitcode:signal)
%h / %Held Hold state of job
%j / %JobID Job ID (or job step ID in format jobid.stepid)
%K / %Wckey Workload characterization key
%k / %Comment Comment for job
%L / %NodeList List of nodes where job/job step runs
%l / %TimeLimit Time limit for job/job step
%M / %ReqMemPerNode Memory requested per node
%m / %AllocMemPerNode Memory allocated per node
%N / %NodeNum Number of nodes
%n / %JobName Name of job/job step
%P / %Partition Partition associated with job/job step
%p / %Priority Priority of job
%q / %Qos Quality of service level
%R / %Reason Reason for pending state
%r / %ReqNodes Requested nodes
%S / %StartTime Start time of job/job step
%s / %SubmitTime Submit time of job
%t / %State Current state of job/job step
%T / %JobType Job type (e.g., Batch, Interactive)
%U / %UserName Username that submitted the job
%u / %Uid User ID
%x / %ExcludeNodes Nodes excluded from job
%X / %Exclusive Exclusive state of job

Usage Examples

Basic Queries

View all jobs and steps:

cacct

cacct

Display help:

cacct -h

cacct

Hide table header:

cacct -N

cacct

Filter by ID and Name

Query specific job IDs:

cacct -j=30618,30619,30620

cacct

Query by job name:

cacct -n=Test_Job

cacct

Query by name pattern:

cacct -n test

cacct

Filter by User and Account

Query jobs by user:

cacct -u=cranetest

cacct

Query jobs by account:

cacct -A=CraneTest

cacct

Combine account and max lines:

cacct -A ROOT -m 10

cacct

Filter by Partition and QoS

Query jobs in a specific partition:

cacct -p GPU

cacct

Query by QoS:

cacct -q test_qos

cacct

Time Range Filtering

Filter by start time range:

cacct -S=2024-07-22T10:00:00~2024-07-24T10:00:00

cacct

Filter by end time range:

cacct -E=2024-07-22T10:00:00~2024-07-24T10:00:00

cacct

Query jobs submitted in a time range:

cacct -s=2024-01-01T00:00:00~2024-01-31T23:59:59

Query jobs that started after a specific time:

cacct -S=2024-01-15T00:00:00~

Query jobs that ended before a specific time:

cacct -E=~2024-01-31T23:59:59

State Filtering

View only completed jobs:

cacct -t completed

View failed and cancelled jobs:

cacct -t failed,cancelled

View timed-out jobs:

cacct -t time-limit-exceeded

Filter by job type:

# View only container jobs
cacct --type Container

# View batch jobs
cacct --type Batch

# View interactive jobs
cacct --type Interactive

Container Job Management

In addition to basic queries, see ccon command manual for more container-specific operations.

Output Control

Limit output to 10 lines:

cacct -m=10

cacct

JSON output:

cacct --json -j 12345

Custom Format Output

Specify custom output format:

cacct -o="%j %.10n %P %a %t"

cacct

All fields using natural width:

cacct --format "%j %n %t"

Left-aligned with minimum width:

cacct --format "%5j %20n %t"

Right-aligned with minimum width:

cacct --format "%.5j %.20n %t"

Mixed format with labels:

cacct -o="%.8j %20n %-10P %.15U %t"

Combined Filtering

Multiple filters with full output:

cacct -m 10 -j 783925,783889 -t=c -F

cacct

Complex combined query:

cacct -m 10 -E=2024-10-08T10:00:00~2024-10-10T10:00:00 -p CPU -t c

cacct

  • cqueue - View job queue (current/pending jobs and steps)
  • cbatch - Submit batch jobs
  • crun - Run interactive jobs and steps
  • ccancel - Cancel jobs and steps
  • ceff - View job efficiency statistics
  • ccon - Container job management