Skip to content

Commit

Permalink
Use the failure flag of the tasklet runner to detect a failure while …
Browse files Browse the repository at this point in the history
…writing output and throw an error if that happens
  • Loading branch information
lisajulia committed Jul 12, 2024
1 parent 0caf92c commit f8b653f
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions opm/simulators/flow/EclGenericWriter_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -598,20 +598,23 @@ doWriteOutput(const int reportStepNum,
restartValue.addExtra(flores.name, UnitSystem::measure::rate, flores.values);
}
}
// make sure that the previous I/O request has been completed
// and the number of incomplete tasklets does not increase between
// time steps
this->taskletRunner_->barrier();

// check if there might have been a failure in the TaskletRunner
if (this->taskletRunner_->failure()) {
throw std::runtime_error("Failure in the TaskletRunner while writing output.");
}

// first, create a tasklet to write the data for the current time
// step to disk
// create a tasklet to write the data for the current time step to disk
auto eclWriteTasklet = std::make_shared<EclWriteTasklet>(
actionState,
isParallel ? this->collectOnIORank_.globalWellTestState() : std::move(localWTestState),
summaryState, udqState, *this->eclIO_,
reportStepNum, timeStepNum, isSubStep, curTime, std::move(restartValue), doublePrecision);

// then, make sure that the previous I/O request has been completed
// and the number of incomplete tasklets does not increase between
// time steps
this->taskletRunner_->barrier();

// finally, start a new output writing job
this->taskletRunner_->dispatch(std::move(eclWriteTasklet));
}
Expand Down

0 comments on commit f8b653f

Please sign in to comment.