mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
[bugfix] Prevent segmentation fault for unkown keywords in parallel.
If there are unknown keywords and the parser throws an exception then we nevertheless broadcasted the eclipseState and schedule. Unfortunately, these might be null pointers in this case and the serializer will run into a segmentation fault (e.g. when serializing the non-existent TableManager) Broadcasting is now only done if parsing was successful.
This commit is contained in:
parent
fcdb4c33ea
commit
edd6c6fe85
@ -324,9 +324,17 @@ void readDeck(int rank, std::string& deckFilename, std::unique_ptr<Opm::Deck>& d
|
||||
eclipseState = std::make_unique<Opm::ParallelEclipseState>();
|
||||
}
|
||||
|
||||
// In case of parse errors eclipseState/schedule might be null
|
||||
// and trigger segmentation faults in parallel during broadcast
|
||||
// (e.g. when serializing the non-existent TableManager)
|
||||
auto comm = Dune::MPIHelper::getCollectiveCommunication();
|
||||
parseSuccess = comm.min(parseSuccess);
|
||||
try
|
||||
{
|
||||
Opm::eclStateBroadcast(*eclipseState, *schedule, *summaryConfig);
|
||||
if (parseSuccess)
|
||||
{
|
||||
Opm::eclStateBroadcast(*eclipseState, *schedule, *summaryConfig);
|
||||
}
|
||||
}
|
||||
catch(const std::exception& broadcast_error)
|
||||
{
|
||||
@ -344,8 +352,6 @@ void readDeck(int rank, std::string& deckFilename, std::unique_ptr<Opm::Deck>& d
|
||||
errorGuard->clear();
|
||||
}
|
||||
|
||||
|
||||
auto comm = Dune::MPIHelper::getCollectiveCommunication();
|
||||
parseSuccess = comm.min(parseSuccess);
|
||||
|
||||
if (!parseSuccess)
|
||||
|
Loading…
Reference in New Issue
Block a user