Skip to content

Commit 6739284

Browse files
committed
Workflow parser: fix not returning an error if topology generation fails
1 parent 11ae164 commit 6739284

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

DATA/tools/parse

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ for line in f:
105105
if NO_PROCESSING_MODE and len(args) > 2:
106106
print('Cannot use DPL workflow together with DD mode', os.environ['DDMODE'])
107107
raise
108-
109-
def processSubtopology(i, args, tmpdir, reconodes, reconodesmin, recoworkflows, calibworkflows, calibworkflowsdds):
108+
109+
def processSubtopology(i, args, tmpdir, reconodes, reconodesmin, recoworkflows, calibworkflows, calibworkflowsdds, threadsOK):
110110
filename = tmpdir + '/wf' + str(i) + '.dds'
111111
calibcores = '1'
112112
if args[i].startswith('reco'):
@@ -137,6 +137,7 @@ for line in f:
137137
command += ' > ' + filename
138138
print('Running DPL command', command)
139139
retVal = subprocess.run(command, shell=True)
140+
print('Returned with ', retVal.returncode)
140141
if retVal.returncode != 0:
141142
print('Error (' + str(retVal) + ') running command', command)
142143
ftmp = open(filename, 'r')
@@ -146,6 +147,7 @@ for line in f:
146147
break
147148
print(line, end='')
148149
raise
150+
threadsOK[i] = 1
149151
if args[i].startswith('reco'):
150152
recoworkflows.append(filename)
151153
elif args[i].startswith('calib'):
@@ -161,14 +163,18 @@ for line in f:
161163
return
162164
calibworkflows.append(filename)
163165
calibworkflowsdds.append(filename + ':' + calibcores)
164-
166+
165167
subtopologyThreads = []
168+
threadsOK = [0] * len(args)
166169
for i in range(2, len(args)):
167-
t = threading.Thread(target = processSubtopology, args = (i, args, tmpdir, reconodes, reconodesmin, recoworkflows, calibworkflows, calibworkflowsdds))
170+
t = threading.Thread(target = processSubtopology, args = (i, args, tmpdir, reconodes, reconodesmin, recoworkflows, calibworkflows, calibworkflowsdds, threadsOK))
168171
t.start()
169172
subtopologyThreads.append(t)
170173
for t in subtopologyThreads:
171174
t.join()
175+
for i in range(2, len(args)):
176+
if not threadsOK[i]:
177+
raise
172178
if reco_num_nodes_override > 0:
173179
reconodes = reco_num_nodes_override
174180
reconodesmin = min(reconodes, reconodesmin)

0 commit comments

Comments
 (0)