Skip to content

Commit

Permalink
Merge branch 'V2_1-branch' into devel
Browse files Browse the repository at this point in the history
  • Loading branch information
timtheisen committed Jul 20, 2022
2 parents 30e4dbc + 3368ead commit 49fb99e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
7 changes: 7 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
blahp (2.1.4-1) stable; urgency=medium

* Report AllocCPUS of Slurm jobs in status result
* Disable email notifications for blahp->condor jobs

-- Tim Theisen <[email protected]> Wed, 20 Jul 2022 15:30:00 -0500

blahp (2.2.0-1) stable; urgency=medium

* Build without Globus
Expand Down
4 changes: 4 additions & 0 deletions rpm/blahp.spec
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ fi
%{_initrddir}/glite-ce-*

%changelog
* Thu Jul 21 2021 Tim Theisen <[email protected]> 2.1.4-1
- Report AllocCPUS of Slurm jobs in status result
- Disable email notifications for blahp->condor jobs

* Fri Oct 22 2021 Tim Theisen <[email protected]> 2.2.0-1
- Build without Globus

Expand Down
9 changes: 8 additions & 1 deletion src/scripts/slurm_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def get_finished_job_stats(jobid, cluster):
log("Querying sacct for completed job for jobid: %s" % (jobid))

# List of attributes required from sacct
attributes = "JobID,UserCPU,SystemCPU,MaxRSS,ExitCode"
attributes = "JobID,UserCPU,SystemCPU,MaxRSS,ExitCode,AllocCPUS"
child_stdout = os.popen("%s -j %s --noconvert -P --format %s" % (sacct, jobid, attributes))
sacct_data = child_stdout.readlines()
ret = child_stdout.close()
Expand Down Expand Up @@ -358,6 +358,13 @@ def get_finished_job_stats(jobid, cluster):
log("Failed to parse CPU usage for job id %s: %s" % (jobid, row["SystemCPU"]))
raise

if row["AllocCPUS"] != "" and row["JobID"] == jobid:
try:
return_dict['CpusProvisioned'] = int(row["AllocCPUS"])
except:
log("Failed to parse CPU allocation for job id %s: %s" % (jobid, row["SystemCPU"]))
raise

# Take the largest value of MaxRSS across all lines
if row["MaxRSS"] != "":
# Remove the trailing [KMGTP] and scale the value appropriately
Expand Down

0 comments on commit 49fb99e

Please sign in to comment.