diff --git a/opm/autodiff/FlowMainEbos.hpp b/opm/autodiff/FlowMainEbos.hpp index 6489161f2..886577e32 100644 --- a/opm/autodiff/FlowMainEbos.hpp +++ b/opm/autodiff/FlowMainEbos.hpp @@ -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(ss); OpmLog::note(ss.str()); - } + } + + if ( mpi_rank_ == 0 ) + { + return Ewoms::Parameters::printUnused(std::cerr); + } + else + { + return false; + } } void mergeParallelLogFiles()