Skip to content

Commit

Permalink
return DriverStatus::failed
Browse files Browse the repository at this point in the history
  • Loading branch information
BenWibking committed Nov 12, 2024
1 parent 52b0ca0 commit c6f8799
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/driver/driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ DriverStatus EvolutionDriver::Execute() {
// Defaults must be set across all ranks
DumpInputParameters();

DriverStatus driver_status = DriverStatus::complete;

{ // Main t < tmax loop region
PARTHENON_INSTRUMENT
while (tm.KeepGoing() && signal != OutputSignal::analysis) {
Expand Down Expand Up @@ -135,8 +137,10 @@ DriverStatus EvolutionDriver::Execute() {

// TODO(bwibking): check for application debug callback
// currently hard-coded to check for tiny dt
if (tm.dt < 1e-10 * tm.time) {
signal = OutputSignal::final;
if (tm.dt < 1e-6 * tm.time) {
signal = OutputSignal::final;
driver_status = DriverStatus::failed;
// do not return here, since we still want to write an output
}

if (signal == OutputSignal::final) {
Expand All @@ -161,14 +165,16 @@ DriverStatus EvolutionDriver::Execute() {
pmesh->UserWorkAfterLoop(pmesh, pinput, tm);
}

DriverStatus status = tm.KeepGoing() ? DriverStatus::timeout : DriverStatus::complete;
if (driver_status != DriverStatus::failed) {
driver_status = tm.KeepGoing() ? DriverStatus::timeout : DriverStatus::complete;
}
// Do *not* write the "final" output, if this is analysis run.
// The analysis output itself has already been written above before the main loop.
if (signal != OutputSignal::analysis) {
pouts->MakeOutputs(pmesh, pinput, &tm, OutputSignal::final);
}
PostExecute(status);
return status;
PostExecute(driver_status);
return driver_status;
}

void EvolutionDriver::PostExecute(DriverStatus status) {
Expand Down

0 comments on commit c6f8799

Please sign in to comment.