Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions nipype/pipeline/plugins/slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,17 @@ def __init__(self, **kwargs):
super(SLURMPlugin, self).__init__(self._template, **kwargs)

def _is_pending(self, taskid):
# subprocess.Popen requires taskid to be a string
res = CommandLine(
'squeue',
args=' '.join(['-j', '%s' % taskid]),
resource_monitor=False,
terminal_output='allatonce').run()
return res.runtime.stdout.find(str(taskid)) > -1
try:
res = CommandLine(
'squeue',
args=' '.join(['-j', '%s' % taskid]),
resource_monitor=False,
terminal_output='allatonce').run()
return res.runtime.stdout.find(str(taskid)) > -1
except Exception as e:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on #1853 (comment), I think this should specifically be RuntimeError?

Otherwise, this looks reasonable.

if 'Invalid job id' not in str(e):
raise(e)
return False

def _submit_batchtask(self, scriptfile, node):
"""
Expand Down