Skip to content

Commit ccf2b41

Browse files
committed
Fixed PBS plugin to work with the Donders Torque cluster
1 parent 373bddd commit ccf2b41

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

nipype/pipeline/plugins/pbs.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,20 @@ def __init__(self, **kwargs):
4747
super(PBSPlugin, self).__init__(template, **kwargs)
4848

4949
def _is_pending(self, taskid):
50-
result = CommandLine('qstat {}'.format(taskid),
50+
result = CommandLine('qstat -f {}'.format(taskid),
5151
environ=dict(os.environ),
5252
terminal_output='allatonce',
5353
resource_monitor=False,
5454
ignore_exception=True).run()
55+
56+
stdout = result.runtime.stdout
5557
stderr = result.runtime.stderr
56-
errmsg = 'Unknown Job Id' # %s' % taskid
58+
errmsg = 'Unknown Job Id'
5759
success = 'Job has finished'
58-
if success in e: # Fix for my PBS
60+
if (success in stderr) or ('job_state = C' in stdout):
5961
return False
6062
else:
61-
return errmsg not in e
63+
return errmsg not in stderr
6264

6365
def _submit_batchtask(self, scriptfile, node):
6466
cmd = CommandLine('qsub', environ=dict(os.environ),

0 commit comments

Comments
 (0)