aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Hoffmann <volker@cheleb.net>2015-08-26 13:39:30 +0200
committerVolker Hoffmann <volker@cheleb.net>2015-08-26 13:39:30 +0200
commit8da9f33b9bf8f715400a34ad313a224f2c3247e6 (patch)
treeb788fec3c29a057e91665c52e852d355a3b3c796
parentd835e7a86924c25dfcbdb11d49624ef792f3ea6a (diff)
fix: count only running jobs towards allocated cpu cores
-rw-r--r--Common/slurm.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Common/slurm.py b/Common/slurm.py
index bb9381a..0e447d3 100644
--- a/Common/slurm.py
+++ b/Common/slurm.py
@@ -68,7 +68,7 @@ def get_cpu_allocations():
Get CPU Allocations per Partition. Also return sum over all CPU partitions.
Slurm Command:
- squeue --format=%C --partition zbox --noheader
+ squeue --format=%C --partition zbox --noheader --state running
@return: number_of_allocated_cpus - [Dict {'partition': ncpus, ...}]
"""
@@ -80,7 +80,7 @@ def get_cpu_allocations():
partitions = [ 'zbox', 'serial', 'debug' ]
number_of_allocated_cpus = {}
for partition in partitions:
- cmd = [ 'squeue', \
+ cmd = [ 'squeue', '--state=running', \
'--format=%C', '--noheader', "--partition=%s" % partition ]
p = sp.Popen(cmd, stdout=sp.PIPE)
p.wait()