Hi all,
We have a default queue in our configuration that routes jobs to several other execution queues according to certain resources, mostly walltime.
The question: is it possible to have openpbs executing the queuejob hooks after the job has moved to the final execution queue?
Right now, the order I observe is: first execute the hooks, then route the job, so all my queuejob hooks see the same default routing queue as all the job’s queue.
I cannot share the hook… but I will explain better what I’m seeing. I have set the default queue to, let’s say, “queue1”… this one is a routing queue that sends to “queue2” or “queue3”… etc. When users submit a job without specifying the queue with the -q option, my hook will get an empty value in job.queue… if they specify -q queue1, the value will be indeed “queue1” and not any of the destinations.
In another cluster I’m working with (it has pbspro), the job.queue will indeed show “queue2” or “queue3”, etc.
It is like if for openpbs the order after submission is:
execute queuejob hooks
route
execute other hooks
but for pbspro is:
route
execute queuejob hooks
execute other hooks
Is this a know difference between openpbs and pbspro? can the order be changed in openpbs to follow that of pbspro? I really don’t want to code in a hook the logic of the routing queue. Imagine if I add another destination to the routing queue, I would have to modify the hook(s) as well!.
Now, as a user, if I submit a job qsub -l select=..., then myqueue will be unset. User can always explicitly specify the queue switch (e.g. -q queue1) and then it works but the question is when the queue is unspecified.
One could, in principle, set to the default queue:
...
if myqueue is None:
myqueue = pbs.server().default_queue
# myqueue is 'default' at this point
In this scenario, myqueue takes the value of the default queue, and not one of the queues that is should route to (queue1, queue2).
As @pepe_grenoble mentioned, pbspro seems to have a slightly different execution sequence: the queue routing takes place before the execution of the queuejob hook. In that case, myqueue already comes with the queue that is was routed to. So you could do: