Skip to content

Commit 396ce9e

Browse files
committed
Merge pull request #593 from nih-fmrif/pbs
PBS plugin fixes
2 parents 23c87c6 + 77ee3ea commit 396ce9e

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

doc/users/config_file.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ Execution
9595
Perform the hash check on the job submission machine. This option minimizes
9696
the number of jobs submitted to a cluster engine or a multiprocessing pool
9797
to only those that need to be rerun. (possible values: ``true`` and
98-
``false``; default value: ``false``)
98+
``false``; default value: ``true``)
9999

100100
*job_finished_timeout*
101101
When batch jobs are submitted through, SGE/PBS/Condor they could be killed

doc/users/plugins.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ Optional arguments::
114114

115115
template: custom template file to use
116116
qsub_args: any other command line args to be passed to qsub.
117+
max_jobname_len: (PBS only) maximum length of the job name. Default 15.
117118

118119
For example, the following snippet executes the workflow on myqueue with
119120
a custom template::

nipype/pipeline/plugins/pbs.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,27 @@ class PBSPlugin(SGELikeBatchManagerBase):
1919
- template : template to use for batch job submission
2020
- qsub_args : arguments to be prepended to the job execution script in the
2121
qsub call
22+
- max_jobname_len: maximum length of the job name. Default 15.
2223
2324
"""
2425

26+
# Addtional class variables
27+
_max_jobname_len = 15
28+
2529
def __init__(self, **kwargs):
2630
template = """
2731
#PBS -V
2832
"""
2933
self._retry_timeout = 2
3034
self._max_tries = 2
35+
self._max_jobname_length = 15
3136
if 'plugin_args' in kwargs and kwargs['plugin_args']:
3237
if 'retry_timeout' in kwargs['plugin_args']:
3338
self._retry_timeout = kwargs['plugin_args']['retry_timeout']
3439
if 'max_tries' in kwargs['plugin_args']:
3540
self._max_tries = kwargs['plugin_args']['max_tries']
41+
if 'max_jobname_len' in kwargs['plugin_args']:
42+
self._max_jobname_len = kwargs['plugin_args']['max_jobname_len']
3643
super(PBSPlugin, self).__init__(template, **kwargs)
3744

3845
def _is_pending(self, taskid):
@@ -71,6 +78,7 @@ def _submit_batchtask(self, scriptfile, node):
7178
jobnameitems = jobname.split('.')
7279
jobnameitems.reverse()
7380
jobname = '.'.join(jobnameitems)
81+
jobname = jobname[0:self._max_jobname_len]
7482
cmd.inputs.args = '%s -N %s %s' % (qsubargs,
7583
jobname,
7684
scriptfile)

nipype/utils/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
hash_method = timestamp
3737
job_finished_timeout = 5
3838
keep_inputs = false
39-
local_hash_check = false
39+
local_hash_check = true
4040
matplotlib_backend = Agg
4141
plugin = Linear
4242
remove_node_directories = false

0 commit comments

Comments
 (0)