From: Peter Munch Date: Fri, 6 Nov 2020 08:05:54 +0000 (+0100) Subject: Use mpi_processes_within_communicator X-Git-Tag: v9.3.0-rc1~926^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe3abd2ab264bc1c0cb40d3b6118f5739a92c438;p=dealii.git Use mpi_processes_within_communicator --- diff --git a/source/matrix_free/vector_data_exchange.cc b/source/matrix_free/vector_data_exchange.cc index f8ab1fe9b1..17939f8416 100644 --- a/source/matrix_free/vector_data_exchange.cc +++ b/source/matrix_free/vector_data_exchange.cc @@ -426,17 +426,8 @@ namespace internal std::vector sm_import_data_this_indices; // collect ranks of processes of shared-memory domain - const auto sm_ranks = [&]() { - std::vector 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 owning_ranks_of_ghosts(