Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip data parsing when squeue times out #142

Merged
merged 2 commits into from
Jan 13, 2025
Merged
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
16 changes: 13 additions & 3 deletions omnistat/collector_rms.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,13 @@ 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)
if data == None:
logging.warning(
"Failed to capture job information: squeue timed out. "
"Please increase sampling interval or switch to file-based mode."
)
# squeue query output format: JOBID:USER:PARTITION:NUM_NODES:BATCHFLAG
if data.stdout.strip():
elif data.stdout.strip():
data = data.stdout.strip().split(":")
keys = [
"RMS_JOB_ID",
Expand All @@ -111,9 +116,14 @@ def querySlurmJob(self, timeout=1, exit_on_error=False, mode="squeue"):
results["RMS_TYPE"] = "slurm"

# 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():
data = utils.runShellCommand(self.__squeue_steps, timeout=timeout, exit_on_error=exit_on_error)
if data == None:
logging.warning(
"Failed to capture job step information: squeue timed out. "
"Please increase sampling interval or switch to file-based mode."
)
elif 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