Is there a native Slurm tool to get the total elapsed time of history jobs?
Feb 19, 2:34am

Yes, Benjamin, Slurm provides native tools to get the elapsed time of completed (history) jobs. The most common way is to use the sacct command, which is specifically designed to report accounting data for jobs, including their elapsed time.

Using sacct

You can use the following command to get the elapsed time of your jobs:

bash
sacct -j <jobid> --format=JobID,JobName,Elapsed,Start,End,State

Replace <jobid> with your job ID. The Elapsed field will show the total elapsed time of the job.

Example:

bash
sacct -j 12345 --format=JobID,JobName,Elapsed,Start,End,State

This will output something like:

text
JobID    JobName    Elapsed               Start                 End      State
------------ ---------- ---------- ------------------- ------------------- ----------
12345       myjob       01:23:45      2026-02-18T10:00:00  2026-02-18T11:23:45  COMPLETED

Key Options:

  • -j <jobid>: Specify the job ID.
  • --format: Customize the output fields. Elapsed is the field you want.
  • You can also use --parsing for machine-readable output if needed.

For All History Jobs

If you want to see the elapsed time for all your history jobs, you can use:

bash
sacct --format=JobID,JobName,Elapsed,Start,End,State

Notes:

  • sacct reads from the Slurm accounting database, so it works for completed jobs.
  • If you want to see jobs from a specific time range, use --starttime and --endtime.

Would you like help with a specific use case or formatting the output further?

Feb 19, 2:34am

This is a shared conversation and may include unverified content that doesn't reflect Mistral AI's views. Login to resume chatting.

Vibe can make mistakes. Check answers. Learn more