message: fix schwarz_ex1p to set some default number of ranks for individual meshes
diff: //
  // Sample runs: mpirun -np 4 schwarz_ex1p -nm 3 -np1 2 -np2 1 -np3 1
  // mpirun -np 4 schwarz_ex1p -nm 2 -np1 2 -np2 2
  -// mpirun -np 4 schwarz_ex1p -np1 2 -np2 2 -m1 ../../data/star.mesh -m2 ../../data/beam-quad.mesh
  +// mpirun -np 4 schwarz_ex1p -nm 2 -np1 2 -np2 2 -m1 ../../data/star.mesh -m2 ../../data/beam-quad.mesh
  #include "mfem.hpp"
  #include <fstream>
  @@ -93,7 +93,7 @@ int main(int argc, char *argv[])
  rp_levels = 0;
  np_list = 0;
  double rel_tol = 1.e-8;
  - int nmeshes = 2;
  + int nmeshes = 3;
  OptionsParser args(argc, argv);
  args.AddOption(&mesh_file_list[0], "-m1", "--mesh",
  @@ -142,6 +142,21 @@ int main(int argc, char *argv[])
  args.PrintOptions(cout);
  }
  + // Check number of mpi ranks specified for each mesh. If individual mpi ranks
  + // are not specified for all the meshes, set some default values.
  + MFEM_VERIFY(num_procs > nmeshes, "Not enough MPI ranks.");
  + if (np_list.Sum() == 0)
  + {
  + int np_per_mesh = num_procs/nmeshes;
  + for (int i = 0; i < nmeshes; i++)
  + {
  + np_list[i] = np_per_mesh;
  + }
  + np_list[nmeshes-1] += num_procs - nmeshes*np_per_mesh;
  + }
  + MFEM_VERIFY(np_list.Sum() == num_procs, " The individual mpi ranks for each"
  + " of the meshes do not add up to the total ranks specified.");
  +
  // Setup MPI communicator for each mesh by splitting MPI_COMM_WORLD.
  MPI_Comm *comml = new MPI_Comm;
  int color = 0;
  @@ -157,11 +172,6 @@ int main(int argc, char *argv[])
  MPI_Comm_rank(*comml, &myidlocal);
  MPI_Comm_size(*comml, &numproclocal);
  - // Check number of mpi ranks specified for each mesh.
  - MFEM_VERIFY(np_list.Sum() == num_procs, " The individual mpi ranks for each"
  - " of the meshes do not add up to"
  - " the total ranks specified.");
  -
  // Read the mesh from the given mesh file. We can handle triangular,
  // quadrilateral, tetrahedral, hexahedral, surface and volume meshes with
  // the same code.
  