Merge pull request #1845 from blattms/abort-on-unknown-keywords-v2

Abort if flow is run with unknown keywords.
This commit is contained in:
Atgeirr Flø Rasmussen 2019-06-03 15:42:02 +02:00 committed by GitHub
commit 08cec09293
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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()