From 8a664b1464efd267bc1b5fc4255cf6e476966ed8 Mon Sep 17 00:00:00 2001 From: Ben Wibking Date: Tue, 12 Nov 2024 12:36:46 -0500 Subject: [PATCH] return non-zero exit code on failure --- external/parthenon | 2 +- src/main.cpp | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/external/parthenon b/external/parthenon index 52b0ca0c..c6f8799c 160000 --- a/external/parthenon +++ b/external/parthenon @@ -1 +1 @@ -Subproject commit 52b0ca0ce803d9bae7c8eb1cc16abd4e5c1110b3 +Subproject commit c6f8799c3b9747c677ffcdfe983ee6c930892ee8 diff --git a/src/main.cpp b/src/main.cpp index b9ffef63..c14fd5ba 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6,6 +6,7 @@ #include // Parthenon headers +#include "driver/driver.hpp" #include "globals.hpp" #include "parthenon_manager.hpp" @@ -204,6 +205,7 @@ int main(int argc, char *argv[]) { } // This needs to be scoped so that the driver object is destructed before Finalize + parthenon::DriverStatus driver_status{}; { Hydro::HydroDriver driver(pman.pinput.get(), pman.app_input.get(), pman.pmesh.get()); @@ -211,7 +213,7 @@ int main(int argc, char *argv[]) { //driver.pouts->MakeOutputs(pman.pmesh.get(), pman.pinput.get(), &driver.tm, parthenon::SignalHandler::OutputSignal::now); // This line actually runs the simulation - driver.Execute(); + driver_status = driver.Execute(); } // call MPI_Finalize and Kokkos::finalize if necessary @@ -219,5 +221,9 @@ int main(int argc, char *argv[]) { // MPI and Kokkos can no longer be used - return (0); + // check driver_status + if (driver_status == parthenon::DriverStatus::failed) { + return 1; + } + return 0; }