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.
sacctYou can use the following command to get the elapsed time of your jobs:
bashsacct -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.
bashsacct -j 12345 --format=JobID,JobName,Elapsed,Start,End,State
This will output something like:
textJobID JobName Elapsed Start End State ------------ ---------- ---------- ------------------- ------------------- ---------- 12345 myjob 01:23:45 2026-02-18T10:00:00 2026-02-18T11:23:45 COMPLETED
-j <jobid>: Specify the job ID.--format: Customize the output fields. Elapsed is the field you want.--parsing for machine-readable output if needed.If you want to see the elapsed time for all your history jobs, you can use:
bashsacct --format=JobID,JobName,Elapsed,Start,End,State
sacct reads from the Slurm accounting database, so it works for completed jobs.--starttime and --endtime.Would you like help with a specific use case or formatting the output further?
Vibe can make mistakes. Check answers. Learn more