Skip to content

Commit

Permalink
return non-zero exit code on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
BenWibking committed Nov 12, 2024
1 parent 6fd3145 commit 8a664b1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion external/parthenon
10 changes: 8 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <sstream>

// Parthenon headers
#include "driver/driver.hpp"
#include "globals.hpp"
#include "parthenon_manager.hpp"

Expand Down Expand Up @@ -204,20 +205,25 @@ 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());

// output restart file at t=0
//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
pman.ParthenonFinalize();

// MPI and Kokkos can no longer be used

return (0);
// check driver_status
if (driver_status == parthenon::DriverStatus::failed) {
return 1;
}
return 0;
}

0 comments on commit 8a664b1

Please sign in to comment.