Skip to content

Commit 16e6cb5

Browse files
committed
fix wrong exit code / better info on failure
1 parent 9abdc51 commit 16e6cb5

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

MC/bin/o2_dpg_workflow_runner.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -666,15 +666,17 @@ def monitor(self, process_list):
666666

667667
def waitforany(self, process_list, finished):
668668
failuredetected = False
669+
failingpids = []
669670
if len(process_list)==0:
670671
return False
671672

672673
for p in list(process_list):
674+
pid = p[1].pid
673675
returncode = 0
674676
if not self.args.dry_run:
675677
returncode = p[1].poll()
676678
if returncode!=None:
677-
actionlogger.info ('Task ' + str(p[1].pid) + ' ' + str(p[0])+':'+str(self.idtotask[p[0]]) + ' finished with status ' + str(returncode))
679+
actionlogger.info ('Task ' + str(pid) + ' ' + str(p[0])+':'+str(self.idtotask[p[0]]) + ' finished with status ' + str(returncode))
678680
# account for cleared resources
679681
if self.nicevalues[p[0]]==0: # --> change for a more robust way
680682
self.curmembooked-=float(self.maxmemperid[p[0]])
@@ -686,10 +688,11 @@ def waitforany(self, process_list, finished):
686688
finished.append(p[0])
687689
process_list.remove(p)
688690
if returncode!=0:
689-
failuredetected = True
691+
failuredetected = True
692+
failingpids.append(pid)
690693

691694
if failuredetected and self.stoponfailure:
692-
actionlogger.info('Stoping pipeline due to failure in a stage PID')
695+
actionlogger.info('Stoping pipeline due to failure in stages with PID ' + str(failingpids))
693696
# self.analyse_files_and_connections()
694697
self.stop_pipeline_and_exit(process_list)
695698

MC/run/PWGHF/embedding_benchmark.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,3 @@ ${O2DPG_ROOT}/MC/bin/o2dpg_sim_workflow.py -eCM 13000 -col pp -proc ccbar -tf ${
2929

3030
# run workflow
3131
${O2DPG_ROOT}/MC/bin/o2_dpg_workflow_runner.py -f workflow.json
32-
33-
exit 0
34-

0 commit comments

Comments
 (0)