From: Wolfgang Bangerth Date: Sun, 11 Mar 2018 07:06:29 +0000 (-0700) Subject: Document why using MPI_COMM_WORLD is ok in one place. X-Git-Tag: v9.0.0-rc1~336^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F6033%2Fhead;p=dealii.git Document why using MPI_COMM_WORLD is ok in one place. --- diff --git a/source/lac/scalapack.cc b/source/lac/scalapack.cc index 70a0665c8f..6ea55a6f96 100644 --- a/source/lac/scalapack.cc +++ b/source/lac/scalapack.cc @@ -407,8 +407,18 @@ ScaLAPACKMatrix::copy_to (ScaLAPACKMatrix &dest) const ierr = MPI_Group_union(group_source, group_dest, &group_union); AssertThrowMPI(ierr); MPI_Comm mpi_communicator_union; - // to create a communicator representing the union of the source and destination MPI communicator - // we need a communicator containing all desired processes --> use MPI_COMM_WORLD + + // to create a communicator representing the union of the source + // and destination MPI communicator we need a communicator that + // is guaranteed to contain all desired processes -- i.e., + // MPI_COMM_WORLD. on the other hand, as documented in the MPI + // standard, MPI_Comm_create_group is not collective on all + // processes in the first argument, but instead is collective on + // only those processes listed in the group. in other words, + // there is really no harm in passing MPI_COMM_WORLD as the + // first argument, even if the program we are currently running + // and that is calling this function only works on a subset of + // processes ierr = MPI_Comm_create_group(MPI_COMM_WORLD, group_union, 5, &mpi_communicator_union); AssertThrowMPI(ierr);