Currently, I am running a job array of 1000 using Slurm. When it is done, I use sacct to see how much time was actually taken. I would like to see what was the longest running job. It would be the largest value under the "Elapsed" column. Is there a way to sort it?
sacct -o reqmem,maxrss,averss,elapsed -j 44523498
ReqMem MaxRSS AveRSS Elapsed
---------- ---------- ---------- ----------
800Mn 02:24:15
800Mn 655756K 655756K 02:24:15
800Mn 844K 344K 02:24:17
800Mn 02:10:08
800Mn 631912K 631912K 02:10:08
800Mn 1032K 344K 02:10:08
800Mn 01:38:14
800Mn 635304K 635304K 01:38:14
800Mn 848K 348K 01:38:14
800Mn 02:28:04
This is what I have below. Thanks!
The easiest way would be to display the elapsed as the first column and use the sort command. sort sorts alphanumerically, which will work with the Slurm time formatting thanks to the 2-digit padding.
sacct -o elapsed,reqmem,maxrss,averss -j 44523498 | sort
You can additionally use the -n flag to avoid the header lines, if you do not want them to clutter the output.
Note that sort can be told to sort on a specific column, with the -k flag but here the number of column is different for job steps and job summary. You can remove the job step information (which is redundant w.r.t elapsed) with -X.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With