Skip to content

Commit

Permalink
BUG Executor process exits non-zero if the fails. Does this after sto…
Browse files Browse the repository at this point in the history
…ring outcome in database.
  • Loading branch information
gadorlhiac committed Apr 11, 2024
1 parent df08adb commit e94c1be
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lute/execution/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
__all__ = ["BaseExecutor", "Executor", "MPIExecutor"]
__author__ = "Gabriel Dorlhiac"

import sys
import _io
import logging
import subprocess
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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)

0 comments on commit e94c1be

Please sign in to comment.