You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
polling for jobs removed from the queue does not properly mark them as completed #401
If a job is attached (or, depending on the polling interval, in normal usage scenarios), a tracked job may be gone from the queue when its status is polled. This is supposed to mark the job as COMPLETED, but there are reports that this is broken.
I then manually monitored the queue (i.e. with squeue) until the job finished and was no longer visible in the squeue history.
Then I ran the following block:
frompsijimportJobExecutor, Jobjob_executor=JobExecutor.get_instance("slurm")
job=Job()
job_executor.attach(job, "13203806") # native ID from aboveprint(job.status.state)
It returned NEW every time I printed the state. It also reported an error in logging like what follows, but this did not hinder the return of job.status.state as NEW.
Job 651f97ae-c467-4c4d-9edd-f16bf2371d89: failed clean submit script: [Errno 2] No such file or directory: '/global/homes/r/rosen/.psij/work/slurm/651f97ae-c467-4c4d-9edd-f16bf2371d89.job'
I was never able to get it to return COMPLETED. Unfortunately, the Slurm squeue job states are cleared very quickly on Perlmutter and so this makes it impractical to retrieve a status of COMPLETED when using .attach (unless you happen to get lucky).
I am getting the error above, and that should be fixed (clarification: we should fix that, it's not fixed yet), but if I add a wait() or sleep(3) after attach, the job shows as COMPLETED. So I think the main issue goes back to the fact that it takes a bit for the job status to be updated after attach().
For reference, the "failed to clean submit script" error was fixed by #403 and the COMPLETED state should be reachable with the requisite wait() after attach().
Activity
Andrew-S-Rosen commentedon Aug 3, 2023
I can now confirm that this is indeed an issue.
On Perlmutter at NERSC, I ran the following code-block to submit a simple toy job.
I then manually monitored the queue (i.e. with
squeue) until the job finished and was no longer visible in thesqueuehistory.Then I ran the following block:
It returned
NEWevery time I printed the state. It also reported an error inlogginglike what follows, but this did not hinder the return ofjob.status.stateasNEW.I was never able to get it to return
COMPLETED. Unfortunately, the Slurmsqueuejob states are cleared very quickly on Perlmutter and so this makes it impractical to retrieve a status ofCOMPLETEDwhen using.attach(unless you happen to get lucky).hategan commentedon Aug 10, 2023
I am getting the error above, and that should be fixed (clarification: we should fix that, it's not fixed yet), but if I add a
wait()orsleep(3)afterattach, the job shows asCOMPLETED. So I think the main issue goes back to the fact that it takes a bit for the job status to be updated afterattach().hategan commentedon Aug 10, 2023
PR #403 fixes the "failed to clean submit script" error.
hategan commentedon Sep 12, 2023
@Andrew-S-Rosen, can I close this?
Andrew-S-Rosen commentedon Sep 12, 2023
@hategan: Yes, thank you for asking. Go ahead and close the issue.
hategan commentedon Sep 12, 2023
Thank you!
For reference, the "failed to clean submit script" error was fixed by #403 and the COMPLETED state should be reachable with the requisite
wait()afterattach().