Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pyslurm/core/job/step.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ cdef class JobSteps(dict):
msg = f"Failed to load step info for Job {job.id}."
raise RPCError(msg=msg)

if job.id not in data:
# slurm_get_job_steps returns all running steps for the whole array
# job when using the Master Array ID. So we still have data when
# other Jobs of the Array-Job are still running, but just not for
# Master anymore. Just return empty then, since this Task is already done
return steps

steps.update(data[job.id])
return steps

Expand Down Expand Up @@ -443,6 +450,7 @@ cdef class JobStep:
def container_id(self):
return cstr.to_unicode(self.ptr.container_id)

@property
def array_id(self):
return u32_parse(self.ptr.array_job_id)

Expand Down
10 changes: 10 additions & 0 deletions tests/integration/test_job_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,13 @@ def test_parse_all(submit_job):
job = submit_job()
util.wait()
JobStep.load(job, "batch").to_dict()


def test_ignore_array_master(submit_job):
job = submit_job(array="1-3")
util.wait()

assert JobSteps.load(job)
job.cancel()
util.wait(2)
assert not JobSteps.load(job)
Loading