Custom resource in hook not available

Hello,

I have a custom resource in server_priv/resourcedef like this:
scratch_local type=size flag=h

When I submit a job like this:
qsub -l select=1:scratch_local=400MB

Is it possible to read the resource in a hook (execjob_begin, execjob_end, …)? It is not available in pbs.event().job.Resource_List. Why I cant see it here?

Thx,
VCh

Sure it is. But it’s not listed separately, it’s part of Resource_List[“select”], which you have to parse (not that hard, since chunk specifications are “+” separated and within these entries are “:” separated).

Thank you for reply but pbs.event().job.Resource_List.keys() is [‘walltime’, ‘ncpus’, ‘mem’, ‘place’]. No “select” here. I can parse pbs.event().job.exec_vnode but not sure if this is the best way.

In order for it to show up in the Resources_List[“select”] line you will need to add it to the resources line in the sched config file. Please add your custom resource to the resources line in the sched_config file and restart the scheduler.

I already have the custom resource between resources in sched_config.

Now I got it. Resources_List[“select”] is available in the event runjob, not in the events execjob_begin,execjob_end,…

In a mom hook, you can ask the server for the value by doing (ala qstat -f):
e=pbs.event()
j=pbs.server().job(e.job.id)
print j.Resource_List[‘select’]

1 Like