mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Abort if flow is run with unknown keywords.
This change will print the encountered unknown keywords to std::cerr (albeit in the format ThisKeyword and not --this-keyword) and abort before running the simulator.
This commit is contained in:
parent
2d27226538
commit
9b0e86a172
@ -227,7 +227,19 @@ namespace Opm
|
||||
setupOutput();
|
||||
setupEbosSimulator();
|
||||
setupLogging();
|
||||
printPRTHeader();
|
||||
int unknownKeyWords = printPRTHeader();
|
||||
#if HAVE_MPI
|
||||
int globalUnknownKeyWords;
|
||||
MPI_Allreduce(&unknownKeyWords, &globalUnknownKeyWords, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
|
||||
unknownKeyWords = globalUnknownKeyWords;
|
||||
#endif
|
||||
if ( unknownKeyWords )
|
||||
{
|
||||
#if HAVE_MPI
|
||||
MPI_Finalize();
|
||||
#endif
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
runDiagnostics();
|
||||
createSimulator();
|
||||
|
||||
@ -379,7 +391,8 @@ namespace Opm
|
||||
}
|
||||
|
||||
// Print an ASCII-art header to the PRT and DEBUG files.
|
||||
void printPRTHeader()
|
||||
// \return Whether unkown keywords were seen during parsing.
|
||||
bool printPRTHeader()
|
||||
{
|
||||
if (output_cout_) {
|
||||
const std::string version = moduleVersion();
|
||||
@ -418,7 +431,16 @@ namespace Opm
|
||||
Ewoms::Parameters::printValues<TypeTag>(ss);
|
||||
|
||||
OpmLog::note(ss.str());
|
||||
}
|
||||
}
|
||||
|
||||
if ( mpi_rank_ == 0 )
|
||||
{
|
||||
return Ewoms::Parameters::printUnused<TypeTag>(std::cerr);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void mergeParallelLogFiles()
|
||||
|
Loading…
Reference in New Issue
Block a user