From e94c1be90e420e905799628e17afed6c8b194d28 Mon Sep 17 00:00:00 2001 From: gadorlhiac Date: Thu, 11 Apr 2024 11:11:31 -0700 Subject: [PATCH] BUG Executor process exits non-zero if the fails. Does this after storing outcome in database. --- lute/execution/executor.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lute/execution/executor.py b/lute/execution/executor.py index 43f3f495..9de3a39c 100644 --- a/lute/execution/executor.py +++ b/lute/execution/executor.py @@ -26,6 +26,7 @@ __all__ = ["BaseExecutor", "Executor", "MPIExecutor"] __author__ = "Gabriel Dorlhiac" +import sys import _io import logging import subprocess @@ -315,6 +316,10 @@ def execute_task(self) -> None: for comm in self._communicators: comm.clear_communicator() + if self._analysis_desc.task_result.task_status == TaskStatus.FAILED: + logger.info("Exiting after Task failure. Result recorded.") + sys.exit(-1) + def _store_configuration(self) -> None: """Store configuration and results in the LUTE database.""" record_analysis_db(copy.deepcopy(self._analysis_desc)) @@ -519,3 +524,7 @@ def execute_task(self) -> None: self._store_configuration() for comm in self._communicators: comm.clear_communicator() + + if self._analysis_desc.task_result.task_status == TaskStatus.FAILED: + logger.info("Exiting after Task failure. Result recorded.") + sys.exit(-1)