Location of billable_tres
/ Billing of Trackable Resources (TRES) in New API
#342
-
Hi everyone, While porting to the new pyslurm API, I tried to find the new location of the import pyslurm
jobs = [job for job_id, job in pyslurm.job().get().items()]
print("job", jobs[0]["job_id"], "is billed", jobs[0]["billable_tres"], "trackable resources") I am using pyslurm version 22.5.3 together with SLURM version 22.05.4. However, I have looked through the current pyslurm main branch as well and could not find anything regarding billing or trackable resources (TRES) in the code for import pyslurm
jobs = [job for job_id, job in pyslurm.Jobs.load().items()]
print("job", jobs[0].id, "is billed", jobs[0].some_function_or_attribute_for_tres, "trackable resources") Does this info still exist in the new interface or was this field not ported over? Thanks for your help in advance 🤗 Greetings, Christian |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi, this info doesn't exist in the new interface currently. At the time of implementing the interface I probably didn't see it mentioned anywhere explicitly in the Slurm API for scontrol/squeue, so I just skipped it. But it will be easy to add in, I will do so in the next days. |
Beta Was this translation helpful? Give feedback.
Hey,
yes, getting the info via tres-alloc / tres-req is also an option, but luckily they provide a standalone-field in the C-API which I can just parse.
I just added this new field to the
pyslurm.Job
class. So now, you should be able to do:I'd recommend directly using the
22.5.x
branch for now: https://github.com/PySlurm/pyslurm/tree/22.5.x