Skip to content

Commit

Permalink
Return only those keys that we actually requested
Browse files Browse the repository at this point in the history
  • Loading branch information
TorecLuik committed May 8, 2024
1 parent a5e4be2 commit 7fd2773
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions biomero/slurm_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1321,7 +1321,7 @@ def check_job_status(self,
)[1] for line in result.stdout.split("\n") if line}
logger.debug(f"Job statuses: {job_status_dict}")

# OK, we have to fix a stupid SACCT functionality:
# OK, we have to fix a stupid sacct functionality:
# Problem:
# When you query for a job-id, turns out that it queries
# for this 'JobIdRaw'. And JobIdRaw for arrays is a
Expand All @@ -1337,15 +1337,20 @@ def check_job_status(self,
# '13' since we queried for that one.

# Current workaround: artificially add '13' to our results.
# And remove the fake one(s).
result_dict = {}
for job_id in slurm_job_ids:
# Check if the job ID is not already in the job_status_dict
if job_id not in job_status_dict:
logger.debug(f"Missing job {job_id} in our \
results! Adding it artificially.")
# Add the job ID with a default status of 'PENDING'
job_status_dict[job_id] = 'PENDING'
result_dict[job_id] = 'PENDING'
else:
# Copy those values that we want the keys from
result_dict[job_id] = job_status_dict[job_id]

return job_status_dict, result
return result_dict, result
else:
error = f"Result is not ok: {result}"
logger.error(error)
Expand Down

0 comments on commit 7fd2773

Please sign in to comment.