From ccf2b41d01b336c3ca7ff83a68ee78f23c764a65 Mon Sep 17 00:00:00 2001 From: achetverikov Date: Fri, 15 Dec 2017 22:35:10 +0100 Subject: [PATCH 1/4] Fixed PBS plugin to work with the Donders Torque cluster --- nipype/pipeline/plugins/pbs.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/nipype/pipeline/plugins/pbs.py b/nipype/pipeline/plugins/pbs.py index 6154abad74..160e927176 100644 --- a/nipype/pipeline/plugins/pbs.py +++ b/nipype/pipeline/plugins/pbs.py @@ -47,18 +47,20 @@ def __init__(self, **kwargs): super(PBSPlugin, self).__init__(template, **kwargs) def _is_pending(self, taskid): - result = CommandLine('qstat {}'.format(taskid), + result = CommandLine('qstat -f {}'.format(taskid), environ=dict(os.environ), terminal_output='allatonce', resource_monitor=False, ignore_exception=True).run() + + stdout = result.runtime.stdout stderr = result.runtime.stderr - errmsg = 'Unknown Job Id' # %s' % taskid + 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('qsub', environ=dict(os.environ), From b10062f1c4c6b3770f313135d21537d6ec1fe08c Mon Sep 17 00:00:00 2001 From: achetverikov Date: Fri, 15 Dec 2017 22:47:20 +0100 Subject: [PATCH 2/4] Fixed small bug in plugins/base.py: string inf was supposed to be a number in debug logger --- nipype/pipeline/plugins/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nipype/pipeline/plugins/base.py b/nipype/pipeline/plugins/base.py index e27733ab77..67f7328d13 100644 --- a/nipype/pipeline/plugins/base.py +++ b/nipype/pipeline/plugins/base.py @@ -281,7 +281,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]: From 6c9f69fe67ddbbcad6c290b036a7fc583917d2cf Mon Sep 17 00:00:00 2001 From: achetverikov Date: Thu, 18 Jan 2018 12:40:25 +0100 Subject: [PATCH 3/4] Added myself to .zenodo.json --- .zenodo.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.zenodo.json b/.zenodo.json index fb7ccfc0b8..cd34e7db1e 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -563,6 +563,11 @@ "affiliation": "MIT, HMS", "name": "Ghosh, Satrajit", "orcid": "0000-0002-5312-6729" + }, + { + "affiliation": "Donders Institute for Brain, Cognition and Behavior, Center for Cognitive Neuroimaging", + "name": "Chetverikov, Andrey", + "orcid": "0000-0003-2767-6310" } ], "keywords": [ From eff7b435d42add36c2db439038d1f5865b8212d3 Mon Sep 17 00:00:00 2001 From: achetverikov Date: Thu, 18 Jan 2018 12:45:28 +0100 Subject: [PATCH 4/4] Changed PBS plugin output to file_split --- nipype/pipeline/plugins/pbs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nipype/pipeline/plugins/pbs.py b/nipype/pipeline/plugins/pbs.py index fb9f4ab441..437c901a00 100644 --- a/nipype/pipeline/plugins/pbs.py +++ b/nipype/pipeline/plugins/pbs.py @@ -51,7 +51,7 @@ def __init__(self, **kwargs): def _is_pending(self, taskid): result = CommandLine('qstat -f {}'.format(taskid), environ=dict(os.environ), - terminal_output='allatonce', + terminal_output='file_split', resource_monitor=False, ignore_exception=True).run()