]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use mpi_processes_within_communicator 11150/head
authorPeter Munch <peterrmuench@gmail.com>
Fri, 6 Nov 2020 08:05:54 +0000 (09:05 +0100)
committerPeter Munch <peterrmuench@gmail.com>
Fri, 6 Nov 2020 08:05:54 +0000 (09:05 +0100)
source/matrix_free/vector_data_exchange.cc

index f8ab1fe9b1102a0b0438d761bc880cdb4409d0bd..17939f8416fb27b4fc0c73a45f69160f92823889 100644 (file)
@@ -426,17 +426,8 @@ namespace internal
         std::vector<unsigned int> sm_import_data_this_indices;
 
         // collect ranks of processes of shared-memory domain
-        const auto sm_ranks = [&]() {
-          std::vector<unsigned int> sm_ranks(
-            Utilities::MPI::n_mpi_processes(comm_sm));
-
-          const unsigned int rank = Utilities::MPI::this_mpi_process(comm);
-
-          MPI_Allgather(
-            &rank, 1, MPI_UNSIGNED, sm_ranks.data(), 1, MPI_UNSIGNED, comm_sm);
-
-          return sm_ranks;
-        }();
+        const auto sm_ranks =
+          Utilities::MPI::mpi_processes_within_communicator(comm, comm_sm);
 
         // determine owners of ghost indices and determine requesters
         std::vector<unsigned int> owning_ranks_of_ghosts(

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.