Ticket 5407

Summary: Provide sacct with a way to present timelimit as just seconds
Product: Slurm Reporter: Christopher Samuel <chris>
Component: User CommandsAssignee: Jason Booth <jbooth>
Status: RESOLVED FIXED QA Contact:
Severity: 4 - Minor Issue    
Priority: --- CC: brian, jbooth
Version: 17.11.7   
Hardware: Linux   
OS: Linux   
Site: Swinburne 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: 18.08.0rc1 Target Release: ---
DevPrio: --- Emory-Cloud Sites: ---
Attachments: Patch to print time limit raw.

Description Christopher Samuel 2018-07-10 19:46:49 MDT
Hi there,

A feature request! :-) I'm trying to write a script to give users a "quality of guess" percentage for their requested time limits vs how long the job ran for.

Currently I'm faced with trying to parse the sacct output of days-hours:minutes:seconds but my understanding is that these numbers are already stored in the database in seconds.  It would be really handy to give sacct the ability to not convert these into the standard Slurm format when requested.

I can think of two ways to do this, one would be to make sacct --noconvert not convert times (though of course that might break current users, so perhaps letting --noconvert take an optional argument such as --noconvert=time might be better), and the other being to add an option to the SLURM_TIME_FORMAT environment variable to just print times in seconds.

In both cases you might want to use strftime()'s "%s" seconds since epoch for dates and the raw seconds for timelimit and elapsed.

How does that sound?

All the best,
Chris
Comment 1 Christopher Samuel 2018-07-10 19:55:35 MDT
Of course having just sent that I came across ElapsedRaw, which matches what I want for that field.

However, there's no TimelimitRaw to match, so that seems like the easiest thing to add to match the ElapsedRaw attribute.
Comment 2 Jason Booth 2018-07-11 15:15:06 MDT
Hi Chris,

 I am looking into this issue for you, and I will let you know what I discover.

Kind regards,
Jason
Comment 4 Jason Booth 2018-08-01 10:59:32 MDT
Created attachment 7480 [details]
Patch to print time limit raw.
Comment 7 Jason Booth 2018-08-03 15:02:50 MDT
This has been fixed in the following commit.
https://github.com/SchedMD/slurm/commit/3b4b808db824bb95d57ee9e7504d65fed33c58d1

I am setting this ticket to resolved.

-Jason
Comment 8 Christopher Samuel 2018-08-03 16:29:14 MDT
On Saturday, 4 August 2018 7:02:50 AM AEST bugs@schedmd.com wrote:

> This has been fixed in the following commit.

Thanks Jason, much appreciated!