From fe3abd2ab264bc1c0cb40d3b6118f5739a92c438 Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Fri, 6 Nov 2020 09:05:54 +0100 Subject: [PATCH] Use mpi_processes_within_communicator --- source/matrix_free/vector_data_exchange.cc | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) 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( -- 2.39.5