Use the failure flag of the tasklet runner to detect a failure while writing output and throw an error if that happens

This commit is contained in:
Lisa Julia Nebel 2024-07-12 15:14:27 +02:00
parent c243620057
commit e2126ae817

View File

@ -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();
// first, create a tasklet to write the data for the current time
// step to disk
// 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.");
}
// 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));
}