]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Document why using MPI_COMM_WORLD is ok in one place. 6033/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Sun, 11 Mar 2018 07:06:29 +0000 (00:06 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Sun, 11 Mar 2018 20:39:25 +0000 (14:39 -0600)
source/lac/scalapack.cc

index 70a0665c8ff1501724cc475e59ca93ba80ba20e6..6ea55a6f9646d746405f7c44355db62f36765d31 100644 (file)
@@ -407,8 +407,18 @@ ScaLAPACKMatrix<NumberType>::copy_to (ScaLAPACKMatrix<NumberType> &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);
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.