aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Hoffmann <volker@cheleb.net>2015-09-06 15:07:20 +0200
committerVolker Hoffmann <volker@cheleb.net>2015-09-06 15:07:20 +0200
commit49367f868fb341aec37a2a26efd7855492cb1f8f (patch)
tree766ec981a661a249edd992646c7f8c6f6a207484
parent233bfe2d798ad66787eb6f73603daef37df7b68c (diff)
feat: unfold array jobs (count as individual tasks)
-rw-r--r--Common/slurm.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Common/slurm.py b/Common/slurm.py
index 0e447d3..e59a5b5 100644
--- a/Common/slurm.py
+++ b/Common/slurm.py
@@ -104,7 +104,9 @@ def get_number_of_jobs_by_partition_and_state():
Get Number of Jobs by State and Partition.
Slurm Command:
- squeue --noheader --format=%T:%P --partition=zbox --state=pending
+ squeue --noheader --format=%T:%P --partition=zbox --state=pending --array
+
+ NB: --array unfolds pending array jobs (12_[1..3] => 12_1, 12_2, 12_3)
@return number_of_jobs_by_partition - [Dict {'zbox': {'running': 1}, ...]
"""
@@ -118,6 +120,7 @@ def get_number_of_jobs_by_partition_and_state():
number_of_jobs_by_state = {}
for state in states:
cmd = [ 'squeue', '--noheader', '--format=%T:%P', \
+ '--array', \
"--partition=%s" % partition, \
"--state=%s" % state ]
p = sp.Popen(cmd, stdout=sp.PIPE)