Skip to content

FIX: PBS plugin fix #2344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 5 additions & 0 deletions .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,11 @@
"affiliation": "University College London",
"name": "Mancini, Matteo",
"orcid": "0000-0001-7194-4568"
},
{
"affiliation": "Donders Institute for Brain, Cognition and Behavior, Center for Cognitive Neuroimaging",
"name": "Chetverikov, Andrey",
"orcid": "0000-0003-2767-6310"
}
],
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion nipype/pipeline/plugins/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def _send_procs_to_workers(self, updatehash=False, graph=None):

if len(jobids) > 0:
# send all available jobs
logger.info('Pending[%d] Submitting[%d] jobs Slots[%d]',
logger.info('Pending[%d] Submitting[%d] jobs Slots[%s]',
num_jobs, len(jobids[:slots]), slots or 'inf')

for jobid in jobids[:slots]:
Expand Down
20 changes: 11 additions & 9 deletions nipype/pipeline/plugins/pbs.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,20 @@ def __init__(self, **kwargs):
super(PBSPlugin, self).__init__(template, **kwargs)

def _is_pending(self, taskid):
result = CommandLine(
'qstat {}'.format(taskid),
environ=dict(os.environ),
terminal_output='allatonce',
resource_monitor=False,
ignore_exception=True).run()
errmsg = 'Unknown Job Id' # %s' % taskid
result = CommandLine('qstat -f {}'.format(taskid),
environ=dict(os.environ),
terminal_output='file_split',
resource_monitor=False,
ignore_exception=True).run()

stdout = result.runtime.stdout
stderr = result.runtime.stderr
errmsg = 'Unknown Job Id'
success = 'Job has finished'
if success in e: # Fix for my PBS
if (success in stderr) or ('job_state = C' in stdout):
return False
else:
return errmsg not in e
return errmsg not in stderr

def _submit_batchtask(self, scriptfile, node):
cmd = CommandLine(
Expand Down