runtraj.execution.slurm.wait#
- runtraj.execution.slurm.wait(job_id, poll=30.0, *, cluster=None)[source]#
Wait until every task of a Slurm job array has ended, and return how each ended.
Polls
sacctevery poll seconds. A task that ended other than complete, or with failed simulations (exit 1) or interrupted ones (exit 3), is logged with its state; its simulations stay pending in the status table. Whensacctgives no answer, as on a cluster without Slurm’s accounting database, it askssqueue: while that lists a task it goes on waiting, and when it lists none the job has ended and this returns{}, the status table saying what finished. When neither answers forSILENT_SCHEDULER_SECONDSit stops waiting with an error; the job itself runs on.- Parameters:
- Returns:
{task: (state, exit code)}assacctgives them, such as{"123_0": ("COMPLETED", "0:0")}; empty when onlysqueueanswered.- Return type:
- Raises:
SchedulerError – If neither
sacctnorsqueuegave an answer about the job forSILENT_SCHEDULER_SECONDS.