sacct(1)

🌸 sacct(1) β€” Slurm Commands ✨

okay bestie, sit down, we're reading the sacct page together πŸ’… it's from the Slurm Commands manual, it's long, and this is part 1 of 6 β€” so hydrate before we start πŸ“


✨ NAME ✨

sacct β€” displays accounting data for all jobs and job steps in the Slurm job accounting log or Slurm database πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

sacct [OPTIONS...]

that's literally it. vibes-based invocation. 😌


πŸ’– DESCRIPTION πŸ’–

so here's the tea, bestie: accounting info for jobs you invoke with Slurm gets either logged in the job accounting log file or saved to the Slurm database, depending on how the AccountingStorageType parameter is configured. that's the whole setup 🌈

The sacct command displays job accounting data stored in the job accounting log file or Slurm database, in a whole variety of forms, for your analysis. by default sacct shows you info on jobs, job steps, status, and exitcodes β€” the starter pack πŸ’… and you can tailor the output with the --format= option to specify exactly which fields get shown. main character customization energy ✨

Job records consist of a primary entry for the job as a whole plus entries for job steps. the Job Launch page has a way more detailed description of each type of job step, if you want to go deeper: https://slurm.schedmd.com/job_launch.html#job_record πŸ‘‘

For the root user, sacct displays job accounting data for all users β€” the whole timeline, no cap 😭 although there are options to filter the output so you only report jobs from a specified user or group.

For the non-root user, sacct limits the display of job accounting data to jobs that were launched with their own user identifier (UID) by default. want to see other users' data? that's what --allusers, --user, or --uid are for 🫢

Elapsed time fields are presented as [days-]hours:minutes:seconds[.microseconds]. and no, not everything gets the fancy microsecond treatment β€” only CPU fields will ever have microseconds ⭐

NOTE: if designated, the slurmdbd.conf option PrivateData may further restrict the accounting data visible to users which are not SlurmUser, root, or a user with AdminLevel=Admin. See the slurmdbd.conf man page for additional details on restricting access to accounting data. πŸ”’
NOTE: the contents of Slurm's database are maintained in lower case. this may result in some sacct output differing from that of other Slurm commands. yes, really. don't @ me πŸ’€
NOTE: much of the data reported by sacct has been generated by the wait3() and getrusage() system calls. some systems gather and report incomplete information for these calls; sacct reports values of 0 for this missing data. see your system's getrusage (3) man page for info about which data are actually available on your system. literally can't report what the kernel didn't hand over πŸ™ˆ

πŸ’… OPTIONS πŸ’…

  • -A, --accounts=<account_list> β€” displays jobs when a comma separated list of accounts is given as the argument 🧾
  • --array β€” expand job arrays 🌱 display all array tasks on separate lines instead of displaying groups of array tasks on single lines. one task per line, we love to see it.
  • -L, --allclusters β€” display jobs ran on all clusters. by default, only jobs ran on the cluster from where sacct is called are displayed 🌍
  • -X, --allocations β€” only show statistics relevant to the job allocation itself, not taking steps into consideration.
NOTE: without including steps, utilization statistics for job allocation(s) will be reported as zero. 😭 like, literally zero. that's the trade.
  • -a, --allusers β€” displays all users' jobs when run by user root or if PrivateData is not configured to jobs. otherwise display the current user's jobs 🫢
  • -x, --associations=<assoc_list> β€” displays the statistics only for the jobs running under the association ids specified by the assoc_list operand, which is a comma-separated list of association ids. space characters are not allowed in the assoc_list. default is all associations ✨
  • -B, --batch-script β€” this option will print the batch script of the job if the job used one. if the job didn't have a script, 'NONE' is output πŸ“œ
NOTE: AccountingStoreFlags=job_script is required for this. no flag, no script, sorry bestie.
NOTE: requesting specific job(s) with '-j' is required for this. πŸ‘ˆ
  • -b, --brief β€” displays a brief listing consisting of JobID, State, and ExitCode. the lil three-field snack πŸ“
  • -M, --clusters=<cluster_list> β€” displays the statistics only for the jobs started on the clusters specified by the cluster_list operand, which is a comma-separated list of clusters. space characters are not allowed in the cluster_list. a value of 'all' will query to run on all clusters. the default is current cluster you are executing the sacct command on, or all clusters in the federation when executed on a federated cluster. this option implicitly sets the --local option πŸ‘€
  • -c, --completion β€” use job completion data instead of job accounting. the JobCompType parameter in the slurm.conf file must be defined to a non-none option. does not support federated cluster information (local data only) 🏠
  • -C, --constraints=<constraint_list> β€” comma separated list to filter jobs based on what constraints/features the job requested. multiple options will be treated as 'and' not 'or', so the job would need all constraints specified to be returned, not one or the other. it's giving strict-inclusive 🎯
  • --delimiter=<characters> β€” ASCII characters used to separate the fields when specifying the -p or -P options. the default delimiter is a '|'. this option is ignored if -p or -P options are not specified πŸ™ƒ
  • -D, --duplicates β€” allow multiple job records for the same job ID or SLUID to be shown. by default, if multiple job records for the same job ID or SLUID match the request, only the most recent one will be shown. records left in the RESIZING state by a resize operation are also shown by default. duplicate records can result from requeues, federation, resizes, or from jobs reaching the MaxJobId value and resetting. such records can be distinguished by the Submit time stamp, by the OriginalSLUID, or by the SLUID fields πŸ” (iykyk)
  • -E, --endtime=<end_time> β€” select jobs in any state before the specified time. if states are given with the -s option, return jobs in this state before this period. see the DEFAULT TIME WINDOW section (below) for details about how the default values for --starttime and --endtime are determined ⏰

valid time formats are:

HH:MM[:SS][AM|PM]
MMDD[YY][-HH:MM[:SS]]
MM.DD[.YY][-HH:MM[:SS]]
MM/DD[/YY][-HH:MM[:SS]]
YYYY-MM-DD[THH:MM[:SS]]
today, midnight, noon, elevenses (11 AM), fika (3 PM), teatime (4 PM)
now[{+|-}count[seconds(default)|minutes|hours|days|weeks]]

yes, fika is a real accepted value. 3 PM. iconic β˜•πŸŒΈ

  • --env-vars β€” this option will print the running environment of a batch job, otherwise 'NONE' is output 🌿
NOTE: AccountingStoreFlags=job_env is required for this.
NOTE: requesting specific job(s) with '-j' is required for this. πŸ‘ˆ
  • --expand-patterns β€” expand any filename patterns from in StdOut, StdErr and StdIn. fields that map to a range of values will use the first value of the range. for example, "%t" for task id will be replaced by "0" πŸ”
  • --federation β€” show jobs from the federation if a member of one 🌐
  • -f, --file=<file> β€” causes the sacct command to read job accounting data from the named file instead of the current Slurm job accounting log file. only applicable when running the jobcomp/filetxt plugin. setting this flag implicitly enables the -c flag πŸ“‚
  • -F, --flags=<flag_list> β€” comma separated list to filter jobs based on what various ways the jobs were handled. current flags are SchedSubmit, SchedMain, SchedBackfill and StartReceived. SchedSubmit, SchedMain, SchedBackfill describe the scheduler that started the job 🚩
  • -o, --format β€” comma separated list of fields. (use "--helpformat" for a list of available fields) πŸ“‹
NOTE: when using the format option for listing various fields you can put a %NUMBER afterwards to specify how many characters should be printed.

e.g. format=name%30 will print 30 characters of field name right justified. a %-30 will print 30 characters left justified ✨

when set, the SACCT_FORMAT environment variable will override the default format. for example:

SACCT_FORMAT="jobid,user,account,cluster"

set it once, forget it forever πŸ’…

  • -g, --gid=, --group=<gid_or_group_list> β€” displays the statistics only for the jobs started with the GID or the GROUP specified by the gid_list or the group_list operand, which is a comma-separated list. space characters are not allowed. default is no restrictions πŸ‘―
  • -h, --help β€” displays a general help message. the classic 🫢
  • -e, --helpformat β€” print a list of fields that can be specified with the --format option.

fields available:

Account             AdminComment        AllocCPUS           AllocNodes
AllocTRES           AssocID             AveCPU              AveCPUFreq
AveDiskRead         AveDiskWrite        AvePages            AveRSS
AveVMSize           BlockID             Cluster             Comment
Constraints         ConsumedEnergy      ConsumedEnergyRaw   Container
CPUTime             CPUTimeRAW          DBIndex             DerivedExitCode
Elapsed             ElapsedRaw          Eligible            End
Exclusive           ExitCode            Extra               FailedNode
Flags               GID                 Group               JobID
JobIDRaw            JobName             Layout              Licenses
MaxDiskRead         MaxDiskReadNode     MaxDiskReadTask     MaxDiskWrite
MaxDiskWriteNode    MaxDiskWriteTask    MaxPages            MaxPagesNode
MaxPagesTask        MaxRSS              MaxRSSNode          MaxRSSTask
MaxVMSize           MaxVMSizeNode       MaxVMSizeTask       McsLabel
MinCPU              MinCPUNode          MinCPUTask          NCPUS
NNodes              NodeList            NTasks              OriginalSLUID
OverSubscribe       Partition           Planned             PlannedCPU
PlannedCPURAW       Priority            QOS                 QOSRAW
QOSREQ              Reason              ReqCPUFreq          ReqCPUFreqGov
ReqCPUFreqMax       ReqCPUFreqMin       ReqCPUS             ReqMem
ReqNodes            ReqReservation      ReqTRES             Reservation
ReservationId       Restarts            SegmentSize         SLUID
Start               State               StdErr              StdIn
StdOut              Submit              SubmitLine          Suspended
SystemComment       SystemCPU           Timelimit           TimelimitRaw
TotalCPU            TRESUsageInAve      TRESUsageInMax      TRESUsageInMaxNode
TRESUsageInMaxTask  TRESUsageInMin      TRESUsageInMinNode  TRESUsageInMinTask
TRESUsageInTot      TRESUsageOutAve     TRESUsageOutMax     TRESUsageOutMaxNode
TRESUsageOutMaxTask TRESUsageOutMin     TRESUsageOutMinNode TRESUsageOutMinTask
TRESUsageOutTot     UID                 User                UserCPU
WCKey               WCKeyID             WorkDir

okay bestie that's the whole field buffet πŸ“ β€” pick your faves with --format, they're all literally right there.

πŸ’€ NOTE: when you're using Ave[RSS|VM]Size or their values in TRESUsageIn[Ave|Tot], they represent the average/total of the highest watermarks over all ranks in the step. But when you're using sstat, they represent the average/total at the moment the command was run. Different vibe, different meaning, iykyk.
πŸ’€ NOTE: TRESUsage*Min* values represent the lowest highwater mark in the step. the lowest highwater. yes it's a whole oxymoron, keep up 🫢
πŸ’€ NOTE: availability of metrics rely on the jobacct_gather plugin used. for example jobacct_gather/cgroup in combination with cgroup/v2 does not provide Virtual Memory metrics due to limitations in the kernel cgroups interfaces, and will show a 0 for the related fields. so if you're staring at a zero, that's why, it's not you 🧚

The section titled "Job Accounting Fields" describes these fields. (go read it, it's the lore πŸ’…)


  • -j, --jobs=<job[.step]> β€” shows info about the specified job[.step] or a list of job[.step]s. The job[.step] parameter is a comma-separated list of jobs. A SLUID may also be used in place of a numeric job ID. Space characters are not permitted in this list, so don't try it, she will not accept it.
🌸 NOTE: a step id of 'batch' will display the information about the batch step. iconic. By default sacct shows only jobs with Eligible time, but with this option the non-eligible will be also shown. πŸ‘€ NOTE: if --state is also specified, since non-eligible are not PD, then non-eligible jobs will not be displayed. See the DEFAULT TIME WINDOW section (below) for details about how this option changes the default values for --starttime and --endtime.
  • --json, --json=list, --json=<data_parser> β€” dump job information as JSON using the default data_parser plugin, or an explicit data_parser with parameters. Sorting and formatting arguments will be ignored β€” JSON does what it wants, main character energy ✨
  • --local β€” show only jobs local to this cluster. Ignore other clusters in this federation (if any). Overrides --federation. stay in your lane, bestie πŸ¦‹
  • -l, --long β€” equivalent to specifying the following, verbatim, no notes:
--format=jobid,jobidraw,jobname,partition,maxvmsize,maxvmsizenode,
maxvmsizetask,avevmsize,maxrss,maxrssnode,maxrsstask,averss,maxpages,
maxpagesnode,maxpagestask,avepages,mincpu,mincpunode,mincputask,avecpu,ntasks,
alloccpus,elapsed,state,exitcode,avecpufreq,reqcpufreqmin,reqcpufreqmax,
reqcpufreqgov,reqmem,consumedenergy,maxdiskread,maxdiskreadnode,maxdiskreadtask,
avediskread,maxdiskwrite,maxdiskwritenode,maxdiskwritetask,avediskwrite,
reqtres,alloctres,tresusageinave,tresusageinmax,
tresusageinmaxn,tresusageinmaxt,tresusageinmin,tresusageinminn,tresusageinmint,
tresusageintot,tresusageoutmax,tresusageoutmaxn,
tresusageoutmaxt,tresusageoutave,tresusageouttot
  • --name=<jobname_list> β€” display jobs that have any of these name(s). yes, plural, you can feed it a whole list πŸŽ€
  • -i, --nnodes=<min[-max]> β€” return jobs that ran on the specified number of nodes. range it up with that min-max bracket notation 🧚
  • -I, --ncpus=<min[-max]> β€” return jobs that ran on the specified number of cpus. same range energy, different resource ⭐
  • --noconvert β€” don't convert units from their original type (e.g. 2048M won't be converted to 2G). raw numbers stay raw, no glow-up πŸ’…
  • -N, --nodelist=<node_list> β€” display jobs that ran on any of these node(s). node_list can be a ranged string.
πŸ™ˆ NOTE: this is not reliable when nodes are added or removed to Slurm while jobs are running. Only jobs that started in the specified time range (-S, -E) will be returned. so like… respect the time window or get nothing, periodt.
  • -n, --noheader β€” no heading will be added to the output. The default action is to display a header. bye bye header πŸ‘‹
  • -p, --parsable β€” output will be '|' delimited with a '|' at the end. See also the --delimiter option. that trailing pipe is not a typo, it's a choice πŸ’–
  • -P, --parsable2 β€” output will be '|' delimited without a '|' at the end. See also the --delimiter option. the sequel, the redemption arc 🌈
  • -r, --partition β€” comma separated list of partitions to select jobs and job steps from. The default is all partitions.
  • -q, --qos β€” only send data about jobs using these qos. Default is all.
  • -R, --reason=<reason_list> β€” comma separated list to filter jobs based on what reason the job wasn't scheduled outside resources/priority. spill the tea on why it's stuck πŸ”₯
  • -S, --starttime β€” select jobs in any state after the specified time. Default is 00:00:00 of the current day, unless the -s or -j options are used. If the -s option is used, then the default is 'now'. If states are given with the -s option then only jobs in this state at this time will be returned. If the -j option is used, then the default time is Unix Epoch 0. See the DEFAULT TIME WINDOW section (below) for details about how default values for --starttime and --endtime are determined.

Valid time formats are:

HH:MM[:SS][AM|PM]
MMDD[YY][-HH:MM[:SS]]
MM.DD[.YY][-HH:MM[:SS]]
MM/DD[/YY][-HH:MM[:SS]]
YYYY-MM-DD[THH:MM[:SS]]
today, midnight, noon, elevenses (11 AM), fika (3 PM), teatime
(4 PM)
now[{+|-}count[seconds(default)|minutes|hours|days|weeks]]

like yes bestie you can literally ask for fika and teatime, the manpage said it first β˜•πŸŒΈ

  • -s, --state=<state_list> β€” selects jobs based on their state during the time period given. Unless otherwise specified, the start and end time will be the current time when the --state option is specified and only currently running jobs can be displayed. A start and/or end time must be specified to view information about jobs not currently running. See the JOB STATE CODES section below for a list of state designators. Multiple state names may be specified using comma separators. Either the short or long form of the state name may be used (e.g. CA or CANCELLED) and the name is case insensitive (i.e. ca and CA both work). slay, options ✨
πŸŽ€ NOTE: for a job to be selected in the PENDING state it must have "EligibleTime" in the requested time interval or different from "Unknown". The "EligibleTime" is displayed by the scontrol show job command. For example jobs submitted with the --hold option will have "EligibleTime=Unknown" as they are pending indefinitely. πŸŽ€ NOTE: when specifying states and no start time is given the default start time is 'now'. This is only when -j is not used. If -j is used the start time will default to 'Epoch'. In both cases if no end time is given it will default to 'now'. See the DEFAULT TIME WINDOW section (below) for details about how this option changes the default values for --starttime and --endtime.
  • -K, --timelimit-max β€” ignored by itself, but if timelimit_min is set this will be the maximum timelimit of the range. Default is no restriction. it only works as a duo, it's giving mutual support 🫢
  • -k, --timelimit-min β€” only send data about jobs with this timelimit. If used with timelimit_max this will be the minimum timelimit of the range. Default is no restriction.
  • -T, --truncate β€” truncate time. So if a job started before --starttime the start time would be truncated to --starttime. The same for end time and --endtime. chop chop βœ‚οΈ
  • -u, --uid=, --user=<uid_or_user_list> β€” use this comma separated list of UIDs or user names to select jobs to display. By default, the running user's UID is used. (yes, it's you by default, the main character πŸ’œ)
  • --units=[KMGTP] β€” display values in specified unit type. Takes precedence over --noconvert option. --units ate and left no crumbs πŸ‘‘
  • --usage β€” display a command usage summary.
  • --use-local-uid β€” when displaying UID, sacct uses the UID stored in Slurm's accounting database by default. Use this command to make Slurm use a system call to get the UID from the username. This option may be useful in an environment with multiple clusters and one database where the UIDs aren't the same on all clusters. federated chaos, handled 🌈
  • -v, --verbose β€” primarily for debugging purposes, report the state of various variables during processing. she's yapping but it's useful yapping πŸ’€
  • -V, --version β€” print version. that's it. that's the whole thing πŸŽ€
  • -W, --wckeys=<wckey_list> β€” bestie this one filters your stats down to only the jobs that started on the wckeys you name. The wckey_list operand is a comma-separated list of wckey names, and no space characters allowed in it, periodt. Default is all wckeys. πŸ’…
  • --whole-hetjob[=yes|no] β€” okay so this is the heterogeneous-jobs behavior switch, listen up 🫢 When you're querying and filtering het jobs with --jobs, Slurm defaults to grabbing info about all the components of the job whenever the het_job_id (the leader id) is the thing you selected. But if you select a non-leader heterogeneous job component id, then only that component gets retrieved by default. This option changes all that: set it to 'yes' (or give no argument at all) and info about all the components comes back no matter which component you picked in the job filter. Set it to 'no' and only the selected heterogeneous job component(s) get retrieved, even when you select the leader. Choose wisely ✨
  • --yaml, --yaml=list, --yaml=<data_parser> β€” dumps job info as YAML, using either the default data_parser plugin or an explicit data_parser with parameters. And heads up: sorting and formatting arguments get ignored when you do this. No cap. πŸ’€

🌸 Job Accounting Fields 🌸

Descriptions of each field option are down below, bestie. Quick vibe check first though β€” note that the Ave*, Max* and Min* accounting fields look at the values for all the tasks of each step in a job and return the average, maximum or minimum values of the task for that job step. Like, for MaxRSS, the returned value is the maximum memory consumption seen by one of the tasks of the step, and MaxRSSTask shows you which task it is. iykyk 🧚

  • ALL β€” Prints all fields listed below. All of them. The whole buffet. πŸ‘‘
  • Account β€” the account the job ran under.
  • AdminComment β€” a comment string on a job that must be set by an administrator, the SlurmUser or root. Not you, babe. πŸ™ˆ
  • AllocCPUs β€” count of allocated CPUs. Equivalent to NCPUS. Same thing, different name, slay.
  • AllocNodes β€” number of nodes allocated to the job/step. It's 0 if the job is pending. ⭐
  • AllocTres β€” trackable resources. These are the resources allocated to the job/step after the job started running. For pending jobs this should be blank. For more details see AccountingStorageTRES in slurm.conf.
NOTE: when a generic resource is configured with the no_consume flag, the allocation will be printed with a zero. πŸ’€
  • AssocID β€” reference to the association of user, account and cluster.
  • AveCPU β€” average (system + user) CPU time of all tasks in job.
  • AveCPUFreq β€” average weighted CPU frequency of all tasks in job, in kHz.
  • AveDiskRead β€” average number of bytes read by all tasks in job.
  • AveDiskWrite β€” average number of bytes written by all tasks in job.
  • AvePages β€” average number of page faults of all tasks in job.
  • AveRSS β€” average resident set size of all tasks in job.
  • AveVMSize β€” average Virtual Memory size of all tasks in job.
  • BlockID β€” the name of the block to be used (used with Blue Gene systems). Vintage behavior, we respect it πŸŽ€
  • Cluster β€” cluster name.
  • Comment β€” the job's comment string when the AccountingStoreFlags parameter in the slurm.conf file contains 'job_comment'. The Comment string can be modified by invoking sacctmgr modify job or the specialized sjobexitmod command. ✨
  • Constraints β€” feature(s) the job requested as a constraint.
  • ConsumedEnergy β€” total energy consumed by all tasks in a job, in joules. Value may include a unit prefix (K,M,G,T,P). Note: only in the case of an exclusive job allocation does this value reflect the job's real energy consumption.
  • ConsumedEnergyRaw β€” total energy consumed by all tasks in a job, in joules. Note: only in the case of an exclusive job allocation does this value reflect the job's real energy consumption. Yeah, same caveat, it's giving "read the fine print" πŸ’…
  • Container β€” path to OCI Container Bundle requested.
  • CPUTime β€” time used (Elapsed time * CPU count) by a job or step, in HH:MM:SS format.
  • CPUTimeRAW β€” time used (Elapsed time * CPU count) by a job or step, in cpu-seconds.
  • DBIndex β€” unique database index for entries in the job table.
  • DerivedExitCode β€” the highest exit code returned by the job's job steps (srun invocations). Following the colon is the signal that caused the process to terminate if it was terminated by a signal. The DerivedExitCode can be modified by invoking sacctmgr modify job or the specialized sjobexitmod command.
  • Elapsed β€” the job's elapsed time. The format of this field's output is:
[DD-[HH:]]MM:SS

as defined by the following:

  • DD β€” days
  • hh β€” hours
  • mm β€” minutes
  • ss β€” seconds
  • ElapsedRaw β€” the job's elapsed time in seconds. Simple. Clean. Iconic. πŸ¦‹
  • Eligible β€” when the job became eligible to run. Same format as End.
  • End β€” termination time of the job. Output is in the format YYYY-MM-DDTHH:MM:SS, unless changed through the SLURM_TIME_FORMAT environment variable. ✨
  • Exclusive β€” indicates whether the job has exclusive access to its allocated resources. The values are:
    • NO β€” the job does not require exclusive access to its allocated resources.
    • NODE β€” the job is allocated all CPUs and GRES on all nodes in the allocation and cannot share nodes with other jobs. This corresponds to the --exclusive option.
    • USER β€” the job cannot share nodes with other jobs unless they are from the same user. This corresponds to the --exclusive=user option.
    • MCS β€” the job cannot share nodes with other jobs unless they are using the same MCS label. This corresponds to the --exclusive=mcs option.
    • TOPO β€” the job cannot share a topology segment with other jobs. This corresponds to the --exclusive=topo option.
NOTE: Partition and Global parameters can set this despite job requests otherwise. πŸ‘€
  • ExitCode β€” the exit code returned by the job script or salloc, typically as set by the exit() function. Following the colon is the signal that caused the process to terminate if it was terminated by a signal.
  • Extra β€” the job's extra string when the AccountingStoreFlags parameter in the slurm.conf file contains 'job_extra'. The Extra string can be modified by invoking the sacctmgr modify job command.
  • FailedNode β€” the name of the node whose failure caused the job to be killed. 😭 rip
  • Flags β€” job flags. Current flags are SchedSubmit, SchedMain, SchedBackfill.
  • GID β€” the group identifier of the user who ran the job.
  • Group β€” the group name of the user who ran the job.
  • JobID β€” the identification number of the job or job step. The forms are:
    • Regular jobs:
JobID[.JobStep]
  • Array jobs:
ArrayJobID_ArrayTaskID
  • Heterogeneous jobs:
HetJobID+HetJobOffset

When printing job arrays, performance of the command can be measurably improved for systems with large numbers of jobs when a single job ID is specified. By default, this field size will be limited to 64 bytes. Use the environment variable SLURM_BITSTR_LEN to specify larger field sizes. πŸ”₯

  • JobIDRaw β€” the identification number of the job or job step. Prints the JobID in the form JobID[.JobStep] for regular, heterogeneous and array jobs.
  • JobName β€” the name of the job or job step. Okay so this is a whole thing: the slurm_accounting.log file is a space delimited file. Because of this, if a space is used in the jobname an underscore is substituted for the space before the record is written to the accounting file. So when the jobname is displayed by sacct the jobname that had a space in it will now have an underscore in place of the space. Character development, honestly πŸ’€
  • Layout β€” what the layout of a step was when it was running. This can be used to give you an idea of which node ran which rank in your job. Lowkey so useful 🫢
  • MaxDiskRead β€” maximum number of bytes read by all tasks in job.
  • MaxDiskReadNode β€” the node on which the maxdiskread occurred.
  • MaxDiskReadTask β€” the task ID where the maxdiskread occurred.
  • MaxDiskWrite β€” maximum number of bytes written by all tasks in job.
  • MaxDiskWriteNode β€” the node on which the maxdiskwrite occurred.
  • MaxDiskWriteTask β€” the task ID where the maxdiskwrite occurred.
  • MaxPages β€” maximum number of page faults of all tasks in job.
  • MaxPagesNode β€” the node on which the maxpages occurred.
  • MaxPagesTask β€” the task ID where the maxpages occurred.
  • MaxRSS β€” maximum resident set size of all tasks in job.
  • MaxRSSNode β€” the node on which the maxrss occurred.
  • MaxRSSTask β€” the task ID where the maxrss occurred.
  • MaxVMSize β€” maximum Virtual Memory size of all tasks in job.
  • MaxVMSizeNode β€” the node on which the maxvmsize occurred.
  • MaxVMSizeTask β€” the task ID where the maxvmsize occurred.
  • MCSLabel β€” the Multi-Category Security (MCS) label that's attached to the job 🏷️. It only shows up when the MCSPlugin is enabled in your slurm.conf, so if this field looks empty, that's why bestie.
  • MinCPU β€” the minimum (system + user) CPU time across all the tasks in the job. Lowest bar of the whole crew πŸ’…
  • MinCPUNode β€” which node that mincpu actually happened on.
  • MinCPUTask β€” which task ID the mincpu happened on.
  • NCPUS β€” total number of CPUs allocated to the job. Literally the same thing as AllocCPUS, no cap.
  • NNodes β€” number of nodes in a job or step. If the job is running (or ran), this is the count that was allocated; otherwise it's the count that was requested.
  • NodeList β€” the list of nodes in the job/step πŸ“
  • NTasks β€” total number of tasks in a job or step.
  • OriginalSLUID β€” the SLUID assigned when the job was first submitted ✨. It stays constant for the entire life of the job even if the job got resized. It does change if the job is requeued or restarted. Use it to correlate runs of jobs that have been resized β€” it's the SLUID that command tools use during the job's runtime.
  • OverSubscribe β€” tells you whether the job can oversubscribe resources with other jobs. Its values are:
    • NO β€” nope, the job cannot oversubscribe resources with other jobs.
    • YES β€” the user requested that the job be able to oversubscribe resources with other jobs. This corresponds to the --oversubscribe option.
    • OK β€” the partition allows oversubscribing resources with other jobs.
    • > NOTE: Partition and Global parameters can set this despite job requests otherwise. πŸ’€
  • Partition β€” identifies the partition the job ran on.
  • Planned β€” how much wall clock time was used as planned time for this job. It's derived from how long the job was waiting from eligible time to when it started or was cancelled. Format is the same as Elapsed.
  • PlannedCPU β€” how many CPU seconds were used as planned time for this job. Format is the same as Elapsed.
  • PlannedCPURAW β€” how many CPU seconds were used as planned time for this job, but formatted in processor seconds.
  • Priority β€” the Slurm priority. πŸ‘‘
  • QOS β€” name of the Quality of Service.
  • QOSRAW β€” the numeric id of the Quality of Service.
  • QOSREQ β€” list of Quality of Services that the job requested.
  • Reason β€” the last reason a job got blocked from running for something other than Priority or Resources πŸ™ˆ. This gets saved in the database even if the job ran all the way to completion.
  • ReqCPUFreq β€” requested CPU frequency for the step, in kHz. Note: this value applies only to a job step. No value is reported for the job itself.
  • ReqCPUFreqGov β€” requested CPU frequency governor for the step, in kHz. Note: this applies only to a job step. No value is reported for the job.
  • ReqCPUFreqMax β€” maximum requested CPU frequency for the step, in kHz. Note: only applies to a job step, nothing gets reported for the job.
  • ReqCPUFreqMin β€” minimum requested CPU frequency for the step, in kHz. Note: again, step-only, no value for the job.
  • ReqCPUS β€” number of requested CPUs.
  • ReqMem β€” minimum required memory for the job. It may have a letter appended showing the units (M for megabytes, G for gigabytes, etc.). Note: this value comes only from the job allocation, not the step.
  • ReqNodes β€” requested minimum Node count for the job/step.
  • ReqTres β€” trackable resources ✨. These are the minimum resource counts requested by the job/step at submission time. For more deets, see AccountingStorageTRES in slurm.conf.
  • ReqReservation β€” a comma separated list of the reservation names the job requested.
  • Reservation β€” Reservation Name.
  • ReservationId β€” Reservation Id.
  • Restarts β€” how many times this job has been requeued/restarted πŸ”
  • SegmentSize β€” when a block topology is used, this is the size of the segments that will be used to create the job allocation.
  • SLUID β€” a unique identifier for a specific run of a job 🌈. Unlike a job ID, the SLUID changes every time a job is requeued/restarted/resized, so you can tell different runs of the same job apart. Previous runs of the job can be shown with the -D/--duplicates option. SLUIDs are globally unique across the accounting system, iykyk.
  • Start β€” initiation time of the job. Same format as End.
  • State β€” displays the job status, or state. See the JOB STATE CODES section below for the list of possible states πŸ’€

If there's more info available on the job state than fits in the current field width (for example, the UID that CANCELLED a job), the state gets followed by a +. You can bump up the size of the displayed state using the %NUMBER format modifier we talked about earlier.

NOTE: The RUNNING state will return suspended jobs as well. If you wanna print suspended jobs, you must request SUSPENDED in a different call from RUNNING.
NOTE: The RUNNING state will return any jobs completed (cancelled or otherwise) in the time period you requested, because the job was also RUNNING during that time. If you're only looking for jobs that finished, please pick the appropriate state(s) without RUNNING.
  • StdErr β€” displays the "filename pattern" for stderr redirection specified in a job or in job steps. Path wildcards will not be substituted β€” they show up exactly as defined in the original batch submission.
  • StdIn β€” displays the "filename pattern" for stdin redirection specified in a job or in job steps. Path wildcards will not be substituted, they're shown as defined in the original batch submission.
  • StdOut β€” displays the "filename pattern" for stdout redirection specified in a job or in job steps. Same deal: path wildcards won't be substituted, they're shown as defined in the original batch submission.
  • Submit β€” the time the job was submitted. Same format as End.
NOTE: If a job is requeued, the submit time gets reset 😭. To get the original submit time you have to use the -D/--duplicates option to display all the duplicate entries for a job.
  • SubmitLine β€” the full command that was issued to submit the job.
  • Suspended β€” the amount of time a job or job step was suspended. Format is the same as Elapsed.
  • SystemComment β€” the job's comment string, typically set by a plugin. Can only be modified by a Slurm administrator πŸ”’
  • SystemCPU β€” the amount of system CPU time used by the job or job step. Format is the same as Elapsed.
NOTE: See the note for TotalCPU for info about how canceled jobs are handled.
  • Timelimit β€” what the timelimit was/is for the job or job step. Format is the same as Elapsed, but two extra special values can show up:
    • Partition_limit β€” indicates the job didn't have its time limit set and wasn't yet subjected to a partition MaxTime (i.e. the job is pending). You can define the DefaultTime on the partition to avoid seeing this value.
    • UNLIMITED β€” indicates the job didn't have a time limit defined at all. Go off, infinite job πŸ’…
  • TimelimitRaw β€” what the timelimit was/is for the job or job step, formatted as a number of minutes. NOTE: see the TimeLimit description above.
  • TotalCPU β€” the sum of the SystemCPU and UserCPU time used by the job or job step. The total CPU time of the job may exceed the job's elapsed time for jobs that include multiple job steps. Format is the same as Elapsed.
NOTE: For steps interrupted by a signal (e.g. scancel, job timeout) TotalCPU gives you a measure of the task's parent process and may not include CPU time of child processes 😭. This is a result of wait3 resource usage (getrusage) internals. For processes that complete in a regular way, all the descendant processes' (forks and execs) resources are included. But if the processes get killed, the result may differ between proctrack plugins and end-user applications.
  • TresUsageInAve β€” TRES average usage in by all tasks in the job. NOTE: if the corresponding TresUsageInMaxTask is -1, the metric is node centric instead of task.
  • TresUsageInMax β€” TRES maximum usage in by all tasks in the job. NOTE: if the corresponding TresUsageInMaxTask is -1, the metric is node centric instead of task.
  • TresUsageInMaxNode β€” the node for which each maximum TRES usage out occurred.
  • TresUsageInMaxTask β€” the task for which each maximum TRES usage out occurred.
  • TresUsageInMin β€” the smallest TRES usage in, across all the tasks in the job. ⚠️ heads up: if the matching TresUsageInMinTask is -1, that means this metric is node-centric, not task-centric.
  • TresUsageInMinNode β€” which node each of those minimum TRES usage-out events happened on.
  • TresUsageInMinTask β€” which task each of those minimum TRES usage-out events happened on.
  • TresUsageInTot β€” total TRES usage in, summed over every task in the job.
  • TresUsageOutAve β€” average TRES usage out across all tasks in the job. ⚠️ note: if the matching TresUsageOutMaxTask is -1, the metric is node-centric instead of task-based.
  • TresUsageOutMax β€” the maximum TRES usage out across all tasks in the job. ⚠️ note: if the matching TresUsageOutMaxTask is -1, again, this one's node-centric rather than task.
  • TresUsageOutMaxNode β€” the node where each maximum TRES usage-out event happened.
  • TresUsageOutMaxTask β€” the task where each maximum TRES usage-out event happened.
  • TresUsageOutMin β€” the minimum TRES usage out across all tasks in the job.
  • TresUsageOutMinNode β€” the node where each minimum TRES usage-out event happened.
  • TresUsageOutMinTask β€” the task where each minimum TRES usage-out event happened.
  • TresUsageOutTot β€” total TRES usage out across every task in the job.
  • UID β€” the numeric user identifier of whoever ran the job.
  • User β€” the actual username of whoever ran the job. (yes, both exist, no you don't have to pick)
  • UserCPU β€” how much user CPU time the job or job step burned through. Same output format as Elapsed.
⚠️ side quest: go read the note under TotalCPU about how canceled jobs get handled, it matters here too.
  • WCKey β€” the Workload Characterization Key. It's just an arbitrary string for grouping orthogonal accounts together. πŸ’…
  • WCKeyID β€” the reference to that wckey.
  • WorkDir β€” the directory the job ran its commands in.

πŸ”₯ JOB STATE CODES πŸ”₯

These are the states sacct recognizes, bestie. If you want the full list of every possible state, it lives at https://slurm.schedmd.com/job_state_codes.html. πŸ¦‹

  • BF BOOT_FAIL β€” job died from a launch failure, typically a hardware thing (think: couldn't boot the node or the block, and the job can't be requeued). πŸ’€
  • CA CANCELLED β€” someone explicitly cancelled it, either the user or a sysadmin. It may or may not have actually been initiated.
  • CD COMPLETED β€” job wrapped up all its processes on every node, exit code zero. slay. ✨
  • DL DEADLINE β€” job hit its deadline and terminated.
  • F FAILED β€” job finished with a non-zero exit code, or some other failure condition. 😭
  • NF NODE_FAIL β€” one or more of the allocated nodes straight-up failed.
  • OOM OUT_OF_MEMORY β€” ran out of memory, rip.
  • PD PENDING β€” job is just sitting there waiting for a resource allocation. we've all been there.
  • PR PREEMPTED β€” job got preempted, so it terminated.
  • R RUNNING β€” job currently holds an allocation. main character energy. πŸ‘‘
  • RQ REQUEUED β€” job got requeued.
  • RS RESIZING β€” job is about to change size.
  • RV REVOKED β€” the sibling got booted from the cluster because another cluster started the job.
  • S SUSPENDED β€” job still has an allocation, but execution is suspended and its CPUs got released so other jobs could use them.
  • TO TIMEOUT β€” job hit its time limit and terminated. periodt.

⏰ DEFAULT TIME WINDOW ⏰

Okay so --starttime and --endtime are the two options that define the window sacct searches inside of. And for "historical and practical reasons" (iconic excuse, no notes), their default values β€” aka the default time window β€” depend on what other options you also passed: specifically --jobs and --state.

Here's the tea, depending on whether --jobs and/or --state are specified, the defaults for --starttime and --endtime are:

WITHOUT EITHER --jobs NOR --state specified:

  • --starttime defaults to Midnight.
  • --endtime defaults to Now.

WITH --jobs AND WITHOUT --state specified:

  • --starttime defaults to Epoch 0.
  • --endtime defaults to Now.

WITHOUT --jobs AND WITH --state specified:

  • --starttime defaults to Now.
  • --endtime defaults to --starttime, and to Now if --starttime isn't specified.

WITH BOTH --jobs AND --state specified:

  • --starttime defaults to Epoch 0.
  • --endtime defaults to --starttime, or to Now if --starttime isn't specified.
πŸ’‘ NOTE: if you run with -v/--verbose, it'll actually tell you a message about the real time window it's using, so you're never just guessing. 🫢

πŸš€ PERFORMANCE πŸš€

Lowkey important, bestie. Every time you execute sacct, it fires off a remote procedure call to slurmdbd. And if enough calls come in at once β€” from sacct or any other Slurm client command that does the same thing β€” it can degrade the slurmdbd daemon's performance, and possibly even result in a denial of service. 😭

So like, do not run sacct or those other RPC-sending Slurm client commands from loops in shell scripts or other programs. fr fr. Make sure your programs keep their calls to sacct down to the bare minimum necessary for whatever info you're trying to gather. πŸ’…


🌈 ENVIRONMENT VARIABLES 🌈

Some sacct options can be set via environment variables. Here they are, matched up with their corresponding options. (Note: command line options will always override these settings, no cap.)

  • SACCT_FEDERATION β€” same as --federation.
  • SACCT_FORMAT β€” lets you define the columns to display in the output. Same as --format.
  • SACCT_LOCAL β€” same as --local.
  • SLURM_BITSTR_LEN β€” sets the string length used for holding a job array's task ID expression. The default value is 64 bytes. A value of 0 will print the full expression at whatever length it needs. Heads up: larger values may adversely impact the application's performance. πŸ™ˆ
  • SLURM_CONF β€” the location of the Slurm configuration file.
  • SLURM_DEBUG_FLAGS β€” specify debug flags for sacct to use. See DebugFlags in the slurm.conf(5) man page for a full list of flags. The environment variable takes precedence over the setting in the slurm.conf. πŸŽ€
  • SLURM_JSON β€” controls JSON serialization:
    • compact β€” output JSON as compact as possible.
    • pretty β€” output JSON in pretty format to make it more readable.
  • SLURM_TIME_FORMAT β€” specifies the format used to report time stamps. A value of standard (the default) generates output in the form "year-month-dateThour:minute:second". A value of relative returns only "hour:minute:second" if it's the current day. For other dates within the current year it prints the "hour:minute" preceded by "Tomorr" (tomorrow), "Ystday" (yesterday), or the name of the day for the coming week (e.g. "Mon", "Tue", etc.), and otherwise the date (e.g. "25 Apr"). For other years it returns a date with month and year and no time (e.g. "6 Jun 2012"). All of the time stamps use a 24 hour format. ⏳

A valid strftime() format can also be specified. For example, a value of "%a %T" will report the day of the week and a time stamp (e.g. "Mon 12:34:56").

  • SLURM_YAML β€” controls YAML serialization:
    • compact β€” output YAML as compact as possible.
    • pretty β€” output YAML in pretty format to make it more readable. ✨

✨ EXAMPLES ✨

okay bestie, this is the fun part β€” let's actually look at it. πŸ’…

This example illustrates the default invocation of the sacct command:

# sacct
Jobid      Jobname    Partition    Account AllocCPUS State     ExitCode
---------- ---------- ---------- ---------- ---------- ---------- --------
2          script01   srun       acct1               1 RUNNING           0
3          script02   srun       acct1               1 RUNNING           0
4          endscript  srun       acct1               1 RUNNING           0
4.0                   srun       acct1               1 COMPLETED         0

This example shows the same job accounting information with the brief option:

# sacct --brief
     Jobid     State  ExitCode
---------- ---------- --------
2          RUNNING           0
3          RUNNING           0
4          RUNNING           0
4.0        COMPLETED         0

and here's what --allocations looks like, same energy, different columns 🫢

# sacct --allocations
Jobid      Jobname    Partition Account    AllocCPUS  State     ExitCode
---------- ---------- ---------- ---------- ------- ---------- --------
3          sja_init   andy       acct1            1 COMPLETED         0
4          sjaload    andy       acct1            2 COMPLETED         0
5          sja_scr1   andy       acct1            1 COMPLETED         0
6          sja_scr2   andy       acct1           18 COMPLETED         2
7          sja_scr3   andy       acct1           18 COMPLETED         0
8          sja_scr5   andy       acct1            2 COMPLETED         0
9          sja_scr7   andy       acct1           90 COMPLETED         1
10         endscript  andy       acct1          186 COMPLETED         0

This example demonstrates the ability to customize the output of the sacct command. The fields are displayed in the order designated on the command line β€” like, you pick the order, main character energy πŸ‘‘

# sacct --format=jobid,elapsed,ncpus,ntasks,state
     Jobid    Elapsed      Ncpus   Ntasks     State
---------- ---------- ---------- -------- ----------
3            00:01:30          2        1 COMPLETED
3.0          00:01:30          2        1 COMPLETED
4            00:00:00          2        2 COMPLETED
4.0          00:00:01          2        2 COMPLETED
5            00:01:23          2        1 COMPLETED
5.0          00:01:31          2        1 COMPLETED

This example demonstrates the use of the -T (--truncate) option when used with -S (--starttime) and -E (--endtime). When the -T option is used, the start time of the job will be the specified -S value if the job was started before the specified time, otherwise the time will be the job's start time. The end time will be the specified -E option if the job ends after the specified time, otherwise it will be the jobs end time.

Without -T (normal operation) sacct output would be like this:

# sacct -S2014-07-03-11:40 -E2014-07-03-12:00 -X -ojobid,start,end,state
    JobID                 Start                  End        State
--------- --------------------- -------------------- ------------
2         2014-07-03T11:33:16   2014-07-03T11:59:01   COMPLETED
3         2014-07-03T11:35:21   Unknown               RUNNING
4         2014-07-03T11:35:21   2014-07-03T11:45:21   COMPLETED
5         2014-07-03T11:41:01   Unknown               RUNNING

By adding the -T option the job's start and end times are truncated to reflect only the time requested. If a job started after the start time requested or finished before the end time requested those times are not altered. The -T option is useful when determining exact run times during any given period.

# sacct -T -S2014-07-03-11:40 -E2014-07-03-12:00 -X -ojobid,jobname,user,start,end,state
    JobID                 Start                  End        State
--------- --------------------- -------------------- ------------
2         2014-07-03T11:40:00   2014-07-03T11:59:01   COMPLETED
3         2014-07-03T11:40:00   2014-07-03T12:00:00   RUNNING
4         2014-07-03T11:40:00   2014-07-03T11:45:21   COMPLETED
5         2014-07-03T11:41:01   2014-07-03T12:00:00   RUNNING
NOTE: If no -s (--state) option is given sacct will display eligible jobs during the specified period of time, otherwise it will return jobs that were in the state requested during that period of time.

This example demonstrates the differences running sacct with and without the --state flag for the same time period. Without the --state option, all eligible jobs in that time period are shown.

# sacct -S11:20:00 -E11:25:00 -X -ojobid,start,end,state
       JobID               Start                 End      State
------------ ------------------- ------------------- ----------
2955                    11:15:12            11:20:12  COMPLETED
2956                    11:20:13            11:25:13  COMPLETED

With the --state=pending option, only job 2956 will be shown because it had a dependency on 2955 and was still PENDING from 11:20:00 until it started at 11:21:13. Note that even though we requested PENDING jobs, the State shows as COMPLETED because that is the current State of the job.

# sacct --state=pending -S11:20:00 -E11:25:00 -X -ojobid,start,end,state
       JobID               Start                 End      State
------------ ------------------- ------------------- ----------
2956                    11:20:13            11:25:13  COMPLETED

πŸŽ€ COPYING πŸŽ€

Copyright (C) 2005-2007 Copyright Hewlett-Packard Development Company L.P. Copyright (C) 2008-2010 Lawrence Livermore National Security. Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). Copyright (C) 2010-2022 SchedMD LLC.

This file is part of Slurm, a resource management program. For details, see <https://slurm.schedmd.com/>.

Slurm is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Slurm is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.


πŸ¦‹ FILES πŸ¦‹

  • /etc/slurm.conf β€” entries to this file enable job accounting and designate the job accounting log file that collects system job accounting.
  • /var/log/slurm_accounting.log β€” the default job accounting log file. By default, this file is set to read and write permission for root only. πŸ”’ so like, don't go thinking you can just peek at it, bestie.

🌈 SEE ALSO 🌈

sstat(1), ps (1), srun(1), squeue(1), getrusage (2), time (2)


and that's a wrap, gorgeous πŸ’– this whole glow-up is Slurm 26.05 energy, from the Slurm Commands collection, and the star of the show is sacct(1) β€” go check on your jobs, you icon πŸ‘‘βœ¨

πŸ“¦ where this page comes from