Ticket 16069

Summary: Alternate format for sacct reserved
Product: Slurm Reporter: Aravind <aravind.padmanabhan>
Component: AccountingAssignee: Director of Support <support>
Status: RESOLVED INFOGIVEN QA Contact:
Severity: 4 - Minor Issue    
Priority: --- CC: benny
Version: 22.05.2   
Hardware: Linux   
OS: Linux   
Site: Sick Kids Alineos Sites: ---
Atos/Eviden Sites: --- Confidential Site: ---
Coreweave sites: --- Cray Sites: ---
DS9 clusters: --- HPCnow Sites: ---
HPE Sites: --- IBM Sites: ---
NOAA SIte: --- OCF Sites: ---
Recursion Pharma Sites: --- SFW Sites: ---
SNIC sites: --- Linux Distro: ---
Machine Name: CLE Version:
Version Fixed: Target Release: ---
DevPrio: --- Emory-Cloud Sites: ---

Description Aravind 2023-02-17 15:32:43 MST
Hi,
I am trying to grab statistics for SLURM jobs. sacct -X -j <job_id> gives me the time the job has been waiting in queue. However, the time is in days-hours:minutes:seconds.
Elapsed time has another mode like elaspedraw that gives me the raw seconds. I was wondering if reserved also has a similar mode that i can use.
Any help is deeply appreciated.
Thank you
Comment 1 Benny Hedayati 2023-02-20 06:44:08 MST
Hi,

sacct has both elapsed and elapsed raw time formats you can use:

sacct -X -j <jobid>  --format=elapsed,elapsedraw  for example:

$ sacct -X -j 743 --format=Elapsed,elapsedraw
   Elapsed ElapsedRaw 
---------- ---------- 
  00:01:01         61 

This documentation explains all the options available to you for sacct:

https://slurm.schedmd.com/sacct.html


I'm not sure if I understand you question:

" I was wondering if reserved also has a similar mode that i can use."

Can you please clarify?

Thanks
Comment 2 Aravind 2023-02-20 19:46:45 MST
Hi Benny,
Thank you for reaching out. 
Really sorry if my message was not clear.
I should have given an example:

aravind@login3:~$ sacct -X -j xxxx -o reserved -n
1-08:16:43


Something like above. The 'reserved' keyword, I presume give the time the job has been waiting in for a node allocation. As you can see it's giving me dd-hh:mm:ss format. I was wondering if it would be possible to get similar to elapsedraw.
I am trying to gather metrics on how long the jobs were waiting before getting a node assigned. 

If there are other ways to gather the same info (please let em know if I need to open another ticket for the same), that would be awesome!

Thank you
Comment 3 Benny Hedayati 2023-02-21 05:03:31 MST
Hi,

Thank you for clarifying.  No, there is no way of changing the "reserved" output to the same as "ElapsedRaw" with sacct.  What you can do is parse the output using Python or another language and change the format to whatever you need through that programming language. 

Thanks
Comment 4 Aravind 2023-02-21 09:16:41 MST
Hi Benny,
Thank you.
Have a good rest of the week!.
Thanks
Comment 5 Benny Hedayati 2023-02-21 09:51:16 MST
Thanks, same to you!
Comment 6 Benny Hedayati 2023-02-21 10:11:49 MST
FYI, check out SLURM_TIME_FORMAT:

https://slurm.schedmd.com/sacctmgr.html#OPT_EndTime

You can format endtime to different format:

SLURM_TIME_FORMAT='%s' sacct -X -j 776 --format=end
                End
-------------------
         1676999040

Does not work for reserved but wanted to mention it in case you would need it.

Thanks