pub struct Record {
pub job_id: String,
pub submit: i64,
pub start: i64,
pub end: i64,
pub elapsed_seconds: u64,
pub alloc_tres: BTreeMap<String, u64>,
pub timelimit: Limit,
pub qos: String,
pub partition: String,
pub state: State,
pub user: String,
}Expand description
One parsed sacct row. Data.
Every field is the row’s own, typed and unfiltered: a step, a running job and a finished job all parse, and what to keep is the caller’s decision.
Fields§
§job_id: StringJobIDRaw as printed: 1041, or 1041.batch for a job step.
submit: i64Submit as Unix seconds, from a civil reading and the caller’s offset.
start: i64Start as Unix seconds.
end: i64End as Unix seconds.
elapsed_seconds: u64ElapsedRaw in seconds.
alloc_tres: BTreeMap<String, u64>AllocTRES as a count per resource name, in name order.
timelimit: LimitTimelimitRaw in minutes, or no limit at all.
qos: StringQOS as printed.
partition: StringPartition as printed.
state: StateState, matched on its first whitespace-separated word.
user: StringUser as printed.
Implementations§
Source§impl Record
impl Record
Sourcepub fn is_step(&self) -> bool
pub fn is_step(&self) -> bool
Whether this row is a job step rather than a job. Calculation.
Slurm writes a step’s JobIDRaw with a dot — 1041.batch, 1044.0 —
and the step is part of the job whose own row is in the same export.
Sourcepub fn gpu_count(&self) -> u64
pub fn gpu_count(&self) -> u64
The GPUs this record’s AllocTRES allocates. Calculation.
Slurm writes both a total and a per-type breakdown when a job asked
for a typed GPU — gres/gpu=3,gres/gpu:a100=3 — so the total wins
where it is present, and the types are summed only where it is not.
Adding both would count the job twice.