Skip to content

Commit 61ebc32

Browse files
author
Chad Cumba
committed
Corrects output for slurm outfiles.
Environment variables can override this, but we are now storing the slurm.out files in the batch directory with the other batchfiles. This commit also removes the hardcoded link to the bbr file in $FSLDIR/etc/ and replaces it with a relative path starting from $FSLDIR.
1 parent a094a91 commit 61ebc32

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

nipype/pipeline/plugins/slurm.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ class SLURMPlugin(SGELikeBatchManagerBase):
3535

3636
def __init__(self, **kwargs):
3737

38-
template="""#!/bin/sh
39-
"""
38+
template="#!/bin/bash"
39+
4040
self._retry_timeout = 2
4141
self._max_tries = 2
4242
self._template = template
@@ -84,9 +84,9 @@ def _submit_batchtask(self, scriptfile, node):
8484
else:
8585
sbatch_args += (" " + node.plugin_args['sbatch_args'])
8686
if '-o' not in sbatch_args:
87-
sbatch_args = '%s -o %s' % (sbatch_args, path)
87+
sbatch_args = '%s -o %s' % (sbatch_args, os.path.join(path, 'slurm-%j.out'))
8888
if '-e' not in sbatch_args:
89-
sbatch_args = '%s -e %s' % (sbatch_args, path)
89+
sbatch_args = '%s -e %s' % (sbatch_args, os.path.join(path, 'slurm-%j.out'))
9090
if '-p' not in sbatch_args:
9191
sbatch_args = '%s -p normal' % (sbatch_args)
9292
if '-n' not in sbatch_args:
@@ -123,6 +123,7 @@ def _submit_batchtask(self, scriptfile, node):
123123
str(e))))
124124
else:
125125
break
126+
logger.debug('Ran command ({0})'.format(cmd.cmdline))
126127
iflogger.setLevel(oldlevel)
127128
# retrieve taskid
128129
lines = [line for line in result.runtime.stdout.split('\n') if line]

nipype/workflows/fmri/fsl/preprocess.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import nipype.pipeline.engine as pe # pypeline engine
77
import nipype.interfaces.freesurfer as fs # freesurfer
88
import nipype.interfaces.spm as spm
9+
import os
910

1011
from ...smri.freesurfer.utils import create_getmask_flow
1112

@@ -1156,7 +1157,8 @@ def create_reg_workflow(name='registration'):
11561157
mean2anatbbr = pe.Node(fsl.FLIRT(), name='mean2anatbbr')
11571158
mean2anatbbr.inputs.dof = 6
11581159
mean2anatbbr.inputs.cost = 'bbr'
1159-
mean2anatbbr.inputs.schedule = '/usr/local/fsl/etc/flirtsch/bbr.sch'
1160+
os.environ['FSLDIR']
1161+
mean2anatbbr.inputs.schedule = os.path.join(os.environ['FSLDIR'],'etc/flirtsch/bbr.sch')
11601162
register.connect(inputnode, 'mean_image', mean2anatbbr, 'in_file')
11611163
register.connect(binarize, 'out_file', mean2anatbbr, 'wm_seg')
11621164
register.connect(inputnode, 'anatomical_image', mean2anatbbr, 'reference')

0 commit comments

Comments
 (0)