diff options
author | Volker Hoffmann <volker@cheleb.net> | 2015-10-09 15:11:50 +0200 |
---|---|---|
committer | Volker Hoffmann <volker@cheleb.net> | 2015-10-09 15:11:50 +0200 |
commit | d77f9c7470ab40d32dcf00d7018d85530c5ec426 (patch) | |
tree | c418cfa0a33b5f36035b47e3b7a31126b5300947 | |
parent | 49367f868fb341aec37a2a26efd7855492cb1f8f (diff) |
fix: Popen.wait() stalls when the pipe is filled up, use Popen.communicate() only -- cf. https://docs.python.org/2/library/subprocess.html#subprocess.Popen.wait
-rw-r--r-- | Common/slurm.py | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/Common/slurm.py b/Common/slurm.py index e59a5b5..4dcd065 100644 --- a/Common/slurm.py +++ b/Common/slurm.py @@ -22,7 +22,6 @@ def get_number_of_nodes_down(): '--list-reasons', '--noheader', \ "--partition=%s" % partition ] p = sp.Popen(cmd, stdout=sp.PIPE) - p.wait() data, _ = p.communicate() if len(data) == 0: count = 0 @@ -83,7 +82,6 @@ def get_cpu_allocations(): cmd = [ 'squeue', '--state=running', \ '--format=%C', '--noheader', "--partition=%s" % partition ] p = sp.Popen(cmd, stdout=sp.PIPE) - p.wait() data, _ = p.communicate() running_sum = 0 if len(data) > 0: @@ -124,7 +122,6 @@ def get_number_of_jobs_by_partition_and_state(): "--partition=%s" % partition, \ "--state=%s" % state ] p = sp.Popen(cmd, stdout=sp.PIPE) - p.wait() data, _ = p.communicate() if len(data) == 0: count = 0 |