Accessing worker ID #628
-
Hi, sorry if I missed something in the docs, but is it possible to access the worker ID within the worker-start-cmd for allocation queues (e.g. by using an environment variable)? Similarly, is there a way to retrieve the ID of the worker that was assigned to a job submission? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi :) #PBS ...
<worker-start-cmd>
hq worker start
<worker-stop-cmd> Therefore, it's not really possible to know the worker ID here (at least with the current design), because the worker hasn't been started yet at the moment when Regarding worker ID, workers are not assigned to jobs, but to individual tasks within a job. But even then it's not so simple! Because we have multi-node tasks, so a single task might have multiple workers, and furthermore, if a worker fails while executing a task, a different worker can be assigned to such task later. So it's not easy to say what is the worker ID of a task. That being said, if you execute |
Beta Was this translation helpful? Give feedback.
Hi :)
Regarding
worker-start-cmd
, this is a bit complicated. The start command is executed within a PBS/Slurm allocation even before a HQ worker is started, something like this:Therefore, it's not really possible to know the worker ID here (at least with the current design), because the worker hasn't been started yet at the moment when
worker-start-cmd
is executed.Regarding worker ID, workers are not assigned to jobs, but to individual tasks within a job. But even then it's not so simple! Because we have multi-node tasks, so a single task might have multiple workers, and furthermore, if a worker fails while executing a task, …