I have started n slurm jobs and I would like to let a separate process wait until at least one of them has finished. The waiting process should use as little cpu time as possible so polling would not be ideal (unless there is no other way).
I know of the scontrol wait_job
, but as far as I can see this can only wait for exactly one job.
If you have sufficient privileges, you can use strigger.
Otherwise, you could use a workflow manager (for instance Fireworks). They typically do polling but at a reasonable pace.
Note that if the action to take is to submit another job, you can also submit it right away and use the --dependency
parameter to delay its execution until ready.