message: Don't print on all ranks in OptionsParser::ParseCheck in parallel
diff: @@ -251,20 +251,29 @@ void OptionsParser::Parse()
  void OptionsParser::ParseCheck(std::ostream &out)
  {
  Parse();
  - if (!Good())
  - {
  - PrintUsage(out);
  #ifdef MFEM_USE_MPI
  - int mpi_is_initialized;
  + int mpi_is_initialized, my_rank;
  int mpi_err = MPI_Initialized(&mpi_is_initialized);
  if (mpi_err == MPI_SUCCESS && mpi_is_initialized)
  {
  - MPI_Finalize();
  + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
  + }
  + else
  + {
  + my_rank = 0;
  }
  +#else
  + int mpi_is_initialized = 0, my_rank = 0;
  +#endif
  + if (!Good())
  + {
  + if (my_rank == 0) { PrintUsage(out); }
  +#ifdef MFEM_USE_MPI
  + if (mpi_is_initialized) { MPI_Finalize(); }
  #endif
  std::exit(1);
  }
  - PrintOptions(out);
  + if (my_rank == 0) { PrintOptions(out); }
  }
  void OptionsParser::WriteValue(const Option &opt, std::ostream &out)
  