Skip to content

Commit

Permalink
handle job info from squeue when there are other jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
morcuended committed Jan 13, 2022
1 parent 3198acc commit 9839f7c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions osa/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,8 +630,6 @@ def get_squeue_output(squeue_output: StringIO) -> pd.DataFrame:
and return a pandas dataframe.
"""
df = pd.read_csv(squeue_output)
# Remove the job array part of the jobid
df["JOBID"] = df["JOBID"].apply(lambda x: x.split("_")[0]).astype("int")
df.rename(
inplace=True,
columns={
Expand All @@ -641,7 +639,18 @@ def get_squeue_output(squeue_output: StringIO) -> pd.DataFrame:
"TIME": "CPUTime",
},
)

# Keep only the jobs corresponding to OSA sequences
df = df[df["JobName"].str.contains("LST1")]

try:
# Remove the job array part of the jobid
df["JobIDD"] = df["JobID"].apply(lambda x: x.split("_")[0]).astype("int")
except AttributeError:
log.debug("No job info could be obtained from squeue")

df["CPUTimeRAW"] = df["CPUTime"].apply(time_to_seconds)

return df


Expand Down

0 comments on commit 9839f7c

Please sign in to comment.