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, theslurmdbd.confoptionPrivateDatamay further restrict the accounting data visible to users which are notSlurmUser, root, or a user withAdminLevel=Admin. See theslurmdbd.confman 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 bysaccthas been generated by thewait3()andgetrusage()system calls. some systems gather and report incomplete information for these calls;sacctreports values of0for this missing data. see your system'sgetrusage(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 wheresacctis 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 ifPrivateDatais 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 ofJobID,State, andExitCode. 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 thesacctcommand on, or all clusters in the federation when executed on a federated cluster. this option implicitly sets the--localoption π-c,--completionβ use job completion data instead of job accounting. theJobCompTypeparameter in theslurm.conffile 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-por-Poptions. the default delimiter is a'|'. this option is ignored if-por-Poptions 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 theRESIZINGstate by a resize operation are also shown by default. duplicate records can result from requeues, federation, resizes, or from jobs reaching theMaxJobIdvalue and resetting. such records can be distinguished by theSubmittime stamp, by theOriginalSLUID, or by theSLUIDfields π (iykyk)-E,--endtime=<end_time>β select jobs in any state before the specified time. if states are given with the-soption, return jobs in this state before this period. see the DEFAULT TIME WINDOW section (below) for details about how the default values for--starttimeand--endtimeare 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 inStdOut,StdErrandStdIn. 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 thesacctcommand to read job accounting data from the named file instead of the current Slurm job accounting log file. only applicable when running thejobcomp/filetxtplugin. setting this flag implicitly enables the-cflag π-F,--flags=<flag_list>β comma separated list to filter jobs based on what various ways the jobs were handled. current flags areSchedSubmit,SchedMain,SchedBackfillandStartReceived.SchedSubmit,SchedMain,SchedBackfilldescribe 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--formatoption.
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 usingAve[RSS|VM]Sizeor their values inTRESUsageIn[Ave|Tot], they represent the average/total of the highest watermarks over all ranks in the step. But when you're usingsstat, 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 thejobacct_gatherplugin used. for examplejobacct_gather/cgroupin combination withcgroup/v2does not provide Virtual Memory metrics due to limitations in the kernel cgroups interfaces, and will show a0for 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 defaultsacctshows only jobs with Eligible time, but with this option the non-eligible will be also shown. π NOTE: if--stateis also specified, since non-eligible are notPD, 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--starttimeand--endtime.
--json,--json=list,--json=<data_parser>β dump job information as JSON using the defaultdata_parserplugin, or an explicitdata_parserwith 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 thatmin-maxbracket 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.2048Mwon't be converted to2G). 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--delimiteroption. 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--delimiteroption. 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 is00:00:00of the current day, unless the-sor-joptions are used. If the-soption is used, then the default is'now'. If states are given with the-soption then only jobs in this state at this time will be returned. If the-joption is used, then the default time is Unix Epoch 0. See the DEFAULT TIME WINDOW section (below) for details about how default values for--starttimeand--endtimeare 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--stateoption 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.CAorCANCELLED) and the name is case insensitive (i.e.caandCAboth work). slay, options β¨
π NOTE: for a job to be selected in thePENDINGstate it must have"EligibleTime"in the requested time interval or different from"Unknown". The"EligibleTime"is displayed by thescontrol show jobcommand. For example jobs submitted with the--holdoption 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-jis not used. If-jis 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--starttimeand--endtime.
-K,--timelimit-maxβ ignored by itself, but iftimelimit_minis 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 withtimelimit_maxthis will be the minimum timelimit of the range. Default is no restriction.-T,--truncateβ truncate time. So if a job started before--starttimethe 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--noconvertoption.--unitsate and left no crumbs π--usageβ display a command usage summary.--use-local-uidβ when displaying UID,sacctuses 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 thehet_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, theSlurmUserorroot. Not you, babe. πAllocCPUsβ count of allocated CPUs. Equivalent toNCPUS. Same thing, different name, slay.AllocNodesβ number of nodes allocated to the job/step. It's0if 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 seeAccountingStorageTRESinslurm.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 theAccountingStoreFlagsparameter in theslurm.conffile contains'job_comment'. TheCommentstring can be modified by invokingsacctmgr modify jobor the specializedsjobexitmodcommand. β¨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, inHH:MM:SSformat.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 (sruninvocations). Following the colon is the signal that caused the process to terminate if it was terminated by a signal. TheDerivedExitCodecan be modified by invokingsacctmgr modify jobor the specializedsjobexitmodcommand.Elapsedβ the job's elapsed time. The format of this field's output is:
[DD-[HH:]]MM:SS
as defined by the following:
DDβ dayshhβ hoursmmβ minutesssβ seconds
ElapsedRawβ the job's elapsed time in seconds. Simple. Clean. Iconic. π¦Eligibleβ when the job became eligible to run. Same format asEnd.Endβ termination time of the job. Output is in the formatYYYY-MM-DDTHH:MM:SS, unless changed through theSLURM_TIME_FORMATenvironment 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--exclusiveoption.USERβ the job cannot share nodes with other jobs unless they are from the same user. This corresponds to the--exclusive=useroption.MCSβ the job cannot share nodes with other jobs unless they are using the same MCS label. This corresponds to the--exclusive=mcsoption.TOPOβ the job cannot share a topology segment with other jobs. This corresponds to the--exclusive=topooption.
NOTE: Partition and Global parameters can set this despite job requests otherwise. π
ExitCodeβ the exit code returned by the job script orsalloc, typically as set by theexit()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 theAccountingStoreFlagsparameter in theslurm.conffile contains'job_extra'. TheExtrastring can be modified by invoking thesacctmgr modify jobcommand.FailedNodeβ the name of the node whose failure caused the job to be killed. π ripFlagsβ job flags. Current flags areSchedSubmit,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 theJobIDin the formJobID[.JobStep]for regular, heterogeneous and array jobs.JobNameβ the name of the job or job step. Okay so this is a whole thing: theslurm_accounting.logfile 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 bysacctthe 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 themaxdiskreadoccurred.MaxDiskReadTaskβ the task ID where themaxdiskreadoccurred.MaxDiskWriteβ maximum number of bytes written by all tasks in job.MaxDiskWriteNodeβ the node on which themaxdiskwriteoccurred.MaxDiskWriteTaskβ the task ID where themaxdiskwriteoccurred.MaxPagesβ maximum number of page faults of all tasks in job.MaxPagesNodeβ the node on which themaxpagesoccurred.MaxPagesTaskβ the task ID where themaxpagesoccurred.MaxRSSβ maximum resident set size of all tasks in job.MaxRSSNodeβ the node on which themaxrssoccurred.MaxRSSTaskβ the task ID where themaxrssoccurred.MaxVMSizeβ maximum Virtual Memory size of all tasks in job.MaxVMSizeNodeβ the node on which themaxvmsizeoccurred.MaxVMSizeTaskβ the task ID where themaxvmsizeoccurred.MCSLabelβ the Multi-Category Security (MCS) label that's attached to the job π·οΈ. It only shows up when theMCSPluginis enabled in yourslurm.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 thatmincpuactually happened on.MinCPUTaskβ which task ID themincpuhappened on.NCPUSβ total number of CPUs allocated to the job. Literally the same thing asAllocCPUS, 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--oversubscribeoption.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 asElapsed.PlannedCPUβ how many CPU seconds were used as planned time for this job. Format is the same asElapsed.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 (Mfor megabytes,Gfor 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, seeAccountingStorageTRESinslurm.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/--duplicatesoption. SLUIDs are globally unique across the accounting system, iykyk.Startβ initiation time of the job. Same format asEnd.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: TheRUNNINGstate will return suspended jobs as well. If you wanna print suspended jobs, you must requestSUSPENDEDin a different call fromRUNNING.
NOTE: TheRUNNINGstate will return any jobs completed (cancelled or otherwise) in the time period you requested, because the job was alsoRUNNINGduring that time. If you're only looking for jobs that finished, please pick the appropriate state(s) withoutRUNNING.
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 asEnd.
NOTE: If a job is requeued, the submit time gets reset π. To get the original submit time you have to use the-D/--duplicatesoption 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 asElapsed.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 asElapsed.
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 asElapsed, 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 partitionMaxTime(i.e. the job is pending). You can define theDefaultTimeon 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 theTimeLimitdescription above.TotalCPUβ the sum of theSystemCPUandUserCPUtime 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 asElapsed.
NOTE: For steps interrupted by a signal (e.g.scancel, job timeout)TotalCPUgives you a measure of the task's parent process and may not include CPU time of child processes π. This is a result ofwait3resource 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 correspondingTresUsageInMaxTaskis-1, the metric is node centric instead of task.TresUsageInMaxβ TRES maximum usage in by all tasks in the job. NOTE: if the correspondingTresUsageInMaxTaskis-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 matchingTresUsageInMinTaskis-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 matchingTresUsageOutMaxTaskis-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 matchingTresUsageOutMaxTaskis-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 asElapsed.
β οΈ 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. π¦
BFBOOT_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). πCACANCELLEDβ someone explicitly cancelled it, either the user or a sysadmin. It may or may not have actually been initiated.CDCOMPLETEDβ job wrapped up all its processes on every node, exit code zero. slay. β¨DLDEADLINEβ job hit its deadline and terminated.FFAILEDβ job finished with a non-zero exit code, or some other failure condition. πNFNODE_FAILβ one or more of the allocated nodes straight-up failed.OOMOUT_OF_MEMORYβ ran out of memory, rip.PDPENDINGβ job is just sitting there waiting for a resource allocation. we've all been there.PRPREEMPTEDβ job got preempted, so it terminated.RRUNNINGβ job currently holds an allocation. main character energy. πRQREQUEUEDβ job got requeued.RSRESIZINGβ job is about to change size.RVREVOKEDβ the sibling got booted from the cluster because another cluster started the job.SSUSPENDEDβ job still has an allocation, but execution is suspended and its CPUs got released so other jobs could use them.TOTIMEOUTβ 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:
--starttimedefaults to Midnight.--endtimedefaults to Now.
WITH --jobs AND WITHOUT --state specified:
--starttimedefaults to Epoch 0.--endtimedefaults to Now.
WITHOUT --jobs AND WITH --state specified:
--starttimedefaults to Now.--endtimedefaults to--starttime, and to Now if--starttimeisn't specified.
WITH BOTH --jobs AND --state specified:
--starttimedefaults to Epoch 0.--endtimedefaults to--starttime, or to Now if--starttimeisn'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 is64bytes. A value of0will 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 forsacctto use. SeeDebugFlagsin theslurm.conf(5)man page for a full list of flags. The environment variable takes precedence over the setting in theslurm.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 ofstandard(the default) generates output in the form"year-month-dateThour:minute:second". A value ofrelativereturns 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 givensacctwill 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
- arch rolling: slurm-llnl 26.05.5.1-1 Β· GPL-2.0-or-later
- epel 10: slurm 26.05.5-1.el10_3 Β· GPL-2.0-or-later AND BSD-2-Clause AND BSD-1-Clause
- nixpkgs unstable: slurm 26-05-5-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms