We are switching from another scheduler to PBS. Previously we had the ability to pass arbitrary attributes into the scheduler. As an example for why, on our clusters, by defaul,t external interfaces are down. Very few jobs use them and there is no sense leaving an external conduit open for BAD™ people to target. We had defined a custom attribute called pubnet. If a user added --attrs=pubnet to their qsub then we would up the interfaces in the job prolog and then down them again in the epilog. I tried #PBS -W pubnet and #PBS -W pubnet=true. AFAICT, you can only pass attrs that PBS knows about, like umask. I don’t believe environment variables will do what we want. We want access to this in the hooks, not in the jobs environment. Is there any way I can get arbitrary attributes from the users command line into a hook?
Did you look into custom resources? AFAIK, you are correct, PBS doesn’t allow you to add custom attributes, we add “custom attributes” via resources instead. Please check out the Custom Resources section of the admin guide (for 2020.1, it’s Chapter 5.14) and let us know if they might serve your use case.
Yes, of course. That should work just fine and I should have thought of it . When all you have is a hammer, everything looks like a nail, so I was looking for an attr, which is nothing more than a string, which is also what a custom resource is. Thanks for the whack upside the head .
Did you try to read j.Variable_List in a hook? i didnt test it but i believe you could read the environment variables there from the job within a hook.
Another way just add a custom resource, and throw all your information to it use some kind of serialization, e.g base64 encoded json, then you could theoretically grab everything. Add one custom resource once for all.
Hi
Ravi is spot on. You can add a string resource with a default value that users can override if they need to. We had to do that with a host level resource called “intel_node” as some of our nodes were AMD and not Intel and at the time didn’t support the avx2 instructions.
Sorta like this:
head node $ qmgr -c ‘create resource intel_node type=string_array,flag=h’
Then also add it to the resources line of /var/spool/pbs/sched_priv/sched_config so its listed along with ncpus and mem etc.
Then I used a short bash script to set it how I wanted it for particular nodes:
for n in 01 02 03 04 14 15 16 17 18 19 20 21 22 23; do
node=“node${n}”
qmgr -c “set node $node resources_available.intel_node=yes”
done
Then HUP the scheduler.
Note: This was done on an older PBSPro installation so might be a bit different to this later OpenPBS version.