sacct
Overview
sacct is the command in Slurm for viewing job accounting data:
- Display detailed information for completed jobs
- Provide more comprehensive historical job data than
squeue - Support complex filtering and formatted output
Common Options
| Option | Description | Example |
|---|---|---|
-j | Filter by job ID | sacct -j 12345,12346 |
-u | Filter by user | sacct -u user1,user2 |
-S、-E | Specify start and end time | sacct -S2022-02-18-11:40 -E2022-03-03-12:00 |
-T | Handle jobs spanning time ranges | sacct -T |
-p | Parsable output (delimiter |) | sacct -p |
-X | Show job-level information only | sacct -X |
-o | Custom output fields | sacct -o "JobID,JobName,Partition,Elapsed" |
--format | Same as -o | sacct --format=JobID%15,State%10 |
-n | Hide headers | sacct -n |
-P | Parsable output (delimiter |) | sacct -P |
| --page-jobs | Set number of jobs per page | sacct --page-jobs 100 |
| --page-last-jobid | Set the last jobid from previous query | sacct --page-last-jobid 123 |
Examples
View details for a specific job
sacct -j 12345
View jobs for the current user
sacct -u $USER
Complex time filtering
sacct -T -S2022-02-18-11:40 -E2022-03-03-12:00
Filter by state
sacct -s COMPLETED,FAILED
Generate CSV output
sacct -P -o "JobID,JobName,Partition,State,Elapsed" > jobs.csv
View job resource usage
sacct -o "JobID,JobName,AllocCPUS,ReqMem,Elapsed" -X
Output Field Details
| Field | Description |
|---|---|
| JobID | Job ID |
| JobName | Job name |
| Partition | Partition name |
| Account | Account name |
| User | Username |
| State | Job state |
| Submit | Submit time |
| Start | Start time |
| End | End time |
| Elapsed | Elapsed time |
| Eligible | Time eligible to run |
| ReqCPUS | Requested CPU count |
| AllocCPUS | Allocated CPU count |
| ReqMem | Requested memory |
| AllocNodes | Allocated node count |