mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Refactored to only check once for errors in parallel.
This simplifies the code a lot (less `#if HAVE_MPI`) and there seems to be not reason not to.
This commit is contained in:
parent
d413a2c960
commit
cd74796004
@ -241,6 +241,17 @@ void readDeck(int rank, std::string& deckFilename, std::unique_ptr<Opm::Deck>& d
|
|||||||
if (!eclipseState)
|
if (!eclipseState)
|
||||||
eclipseState = std::make_unique<Opm::ParallelEclipseState>();
|
eclipseState = std::make_unique<Opm::ParallelEclipseState>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Opm::eclStateBroadcast(*eclipseState, *schedule, *summaryConfig);
|
||||||
|
}
|
||||||
|
catch(const std::exception& e)
|
||||||
|
{
|
||||||
|
failureMessage = e.what();
|
||||||
|
parseSuccess = 0;
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (*errorGuard) { // errors encountered
|
if (*errorGuard) { // errors encountered
|
||||||
@ -265,41 +276,5 @@ void readDeck(int rank, std::string& deckFilename, std::unique_ptr<Opm::Deck>& d
|
|||||||
#endif
|
#endif
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
parseSuccess = 1;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
#if HAVE_MPI
|
|
||||||
Opm::eclStateBroadcast(*eclipseState, *schedule, *summaryConfig);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
catch(const std::exception& e)
|
|
||||||
{
|
|
||||||
failureMessage = e.what();
|
|
||||||
parseSuccess = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (*errorGuard) { // errors encountered
|
|
||||||
parseSuccess = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Print warnings and erors on every rank! Maybe too much?
|
|
||||||
errorGuard->dump();
|
|
||||||
errorGuard->clear();
|
|
||||||
|
|
||||||
parseSuccess = comm.min(parseSuccess);
|
|
||||||
|
|
||||||
if (!parseSuccess)
|
|
||||||
{
|
|
||||||
if (rank == 0)
|
|
||||||
{
|
|
||||||
OpmLog::error(std::string("Unrecoverable errors were encountered while loading input: ")+failureMessage);
|
|
||||||
}
|
|
||||||
#if HAVE_MPI
|
|
||||||
MPI_Finalize();
|
|
||||||
#endif
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} // end namespace Opm
|
} // end namespace Opm
|
||||||
|
Loading…
Reference in New Issue
Block a user