Skip to content

Commit 7ff5148

Browse files
committed
fix: remove temp slurm fix
1 parent 2dd15e7 commit 7ff5148

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

nipype/pipeline/plugins/slurm.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from ...interfaces.base import CommandLine
1616
from .base import (SGELikeBatchManagerBase, logger, iflogger, logging)
1717

18-
import subprocess
1918

2019

2120
class SLURMPlugin(SGELikeBatchManagerBase):
@@ -61,11 +60,10 @@ def __init__(self, **kwargs):
6160

6261
def _is_pending(self, taskid):
6362
# subprocess.Popen requires taskid to be a string
64-
proc = subprocess.Popen(["squeue", '-j', '%s' % taskid],
65-
stdout=subprocess.PIPE,
66-
stderr=subprocess.PIPE)
67-
o, _ = proc.communicate()
68-
return o.find(str(taskid)) > -1
63+
res = CommandLine('squeue',
64+
args=' '.join(['-j', '%s' % taskid]),
65+
terminal_output='allatonce').run()
66+
return res.runtime.stdout.find(str(taskid)) > -1
6967

7068
def _submit_batchtask(self, scriptfile, node):
7169
"""

0 commit comments

Comments
 (0)