mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Throw an error if the status "lastStepFailed" in prepareStep of BlackoilModel is not the same across all processes
This commit is contained in:
@@ -272,7 +272,11 @@ namespace Opm {
|
||||
Dune::Timer perfTimer;
|
||||
perfTimer.start();
|
||||
// update the solution variables in the model
|
||||
if ( timer.lastStepFailed() ) {
|
||||
int lastStepFailed = timer.lastStepFailed();
|
||||
if (grid_.comm().size() > 1 && lastStepFailed != grid_.comm().min(lastStepFailed)) {
|
||||
OPM_THROW(std::runtime_error, fmt::format("Misalignment of the parallel simulation run in prepareStep - the previous step succeeded on rank {} but failed on the other ranks.", grid_.comm().rank()));
|
||||
}
|
||||
if ( lastStepFailed ) {
|
||||
simulator_.model().updateFailed();
|
||||
} else {
|
||||
simulator_.model().advanceTimeLevel();
|
||||
|
||||
Reference in New Issue
Block a user