Skip to content

Commit c2ec358

Browse files
committed
Merge pull request #613 from satra/fix/sge_tacc
fix: check only the last line in the sge qsub stdout
2 parents 7b44101 + 6e3f653 commit c2ec358

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

nipype/pipeline/plugins/sge.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"""
33

44
import os
5+
import re
56
import subprocess
67
from time import sleep
78

@@ -108,7 +109,9 @@ def _submit_batchtask(self, scriptfile, node):
108109
break
109110
iflogger.setLevel(oldlevel)
110111
# retrieve sge taskid
111-
taskid = int(result.runtime.stdout.split(' ')[2])
112+
lines = [line for line in result.runtime.stdout.split('\n') if line]
113+
taskid = int(re.match("Your job ([0-9]*) .* has been submitted",
114+
lines[-1]).groups()[0])
112115
self._pending[taskid] = node.output_dir()
113116
logger.debug('submitted sge task: %d for node %s' % (taskid, node._id))
114117
return taskid

0 commit comments

Comments
 (0)