Closed multimeric closed 1 year ago
Hi @multimeric
I can have a look at that. You mean for the slurmdb_jobs
class, right?
Yes that's right. I would like to return them from .get()
.
This is actually pretty tricky now that I've looked into it. It's a field in the stats
field of the job step class. It's not a top level job field at all.
Hi, since the rework of the slurmdb job api is currently ongoing (#269), I'll focus on properly implementing all the fields in the new api for now, instead of doing it in the current slurmdb_jobs
class
The current API only returns the raw "TRESUsage*" strings. Theoretically, one could access values like maxrss
, by looking at tres_usage_in_max
str in the step for example and getting the value for the MEM
TRES. But yeah, parsing that might not be so much fun, so a convenience attribute like max_rss
is definitely a must :)
If your API supports something like job.steps[0].stats["rss"].max
then that would be fine too? I think that's how the C API works.
All the Job statistic fields are now available in the new recently released API (for 22.05 I just made a new release v22.5.2) The fields are described here
Each Step from the database will have a stats
Attribute of type JobStatistics
Additionally, each Database Job will also have a stats
attribute of type JobStatistics
. I added that one for convenience - so all the statistics from each step are summarized for the whole Job (but only those fields where it makes sense to actually sum them up, like total_cpu time
for example)
Note that I have named the rss
fields a bit different, i.e avg_rss
is called avg_resident_memory
If you have used the API already, let me know what you think and whether it works fine for you :)
Details
v22.5.0
Issue
A few
rss
fields supported by the CLI are not returned bypyslurm
:maxrss
,maxrssnode
,maxrsstask
, andaverss
at least. Could these be added? I assume they are supported by the SLURM ABI.