Skip to content

Commit

Permalink
Make sure squeue isn't timing out
Browse files Browse the repository at this point in the history
Signed-off-by: Jordà Polo <[email protected]>
  • Loading branch information
jordap committed Jan 8, 2025
1 parent f89fe6a commit eeefed0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions omnistat/collector_rms.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def querySlurmJob(self, timeout=1, exit_on_error=False, mode="squeue"):
if mode == "squeue":
data = utils.runShellCommand(self.__squeue_query, timeout=timeout, exit_on_error=exit_on_error)
# squeue query output format: JOBID:USER:PARTITION:NUM_NODES:BATCHFLAG
if data.stdout.strip():
if data and data.stdout.strip():
data = data.stdout.strip().split(":")
keys = [
"RMS_JOB_ID",
Expand All @@ -113,7 +113,7 @@ def querySlurmJob(self, timeout=1, exit_on_error=False, mode="squeue"):
# require a 2nd query to ascertain job steps (otherwise, miss out on batchflag)
data = utils.runShellCommand(self.__squeue_steps, timeout=timeout, exit_on_error=exit_on_error)
results["RMS_STEP_ID"] = -1
if data.stdout.strip():
if data and data.stdout.strip():
# If we are in an active job step, the STEPID will have an integer index appended, e.g.
# 57735.10
# 57735.interactive
Expand Down

0 comments on commit eeefed0

Please sign in to comment.