File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 15
15
from ...interfaces .base import CommandLine
16
16
from .base import (SGELikeBatchManagerBase , logger , iflogger , logging )
17
17
18
- import subprocess
19
18
20
19
21
20
class SLURMPlugin (SGELikeBatchManagerBase ):
@@ -61,11 +60,10 @@ def __init__(self, **kwargs):
61
60
62
61
def _is_pending (self , taskid ):
63
62
# 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
69
67
70
68
def _submit_batchtask (self , scriptfile , node ):
71
69
"""
You can’t perform that action at this time.
0 commit comments