Skip to content

Commit 4963cee

Browse files
committed
Merge pull request #881 from nipy/FixSGEGraphDependancyBug
PERF: SGE Graph submission was potentially very inefficient
2 parents e0537ae + ab2bf8e commit 4963cee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

nipype/pipeline/plugins/sgegraph.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ def _submit_graph(self, pyfiles, dependencies, nodes):
6565
if idx in dependencies:
6666
values = ' '
6767
for jobid in dependencies[idx]:
68-
values += 'job%05d,' % jobid
69-
if 'job' in values:
68+
values += '${job%05d},' % jobid
69+
if values != ' ': # i.e. if some jobs were added to dependency list
7070
values = values.rstrip(',')
7171
deps = '-hold_jid%s' % values
7272
jobname = 'job%05d' % (idx)
@@ -79,7 +79,7 @@ def _submit_graph(self, pyfiles, dependencies, nodes):
7979
if self._qsub_args.count('-o ') == 0:
8080
stdoutFile = '-o {outFile}'.format(
8181
outFile=batchscriptoutfile)
82-
full_line = '{jobNm}=$(qsub {outFileOption} {errFileOption} {extraQSubArgs} {dependantIndex} -N {jobNm} {batchscript})\n'.format(
82+
full_line = '{jobNm}=$(qsub {outFileOption} {errFileOption} {extraQSubArgs} {dependantIndex} -N {jobNm} {batchscript} | awk \'{{print $3}}\')\n'.format(
8383
jobNm=jobname,
8484
outFileOption=stdoutFile,
8585
errFileOption=stderrFile,

0 commit comments

Comments
 (0)