From d9362bf1b24a926731e632aa5fb806bff0ac89b7 Mon Sep 17 00:00:00 2001 From: Dmitri Naumov <github@naumov.de> Date: Thu, 31 Oct 2024 15:49:11 +0100 Subject: [PATCH] [MeL] Use vector allreduce --- .../Utils/transformMeshToNodePartitionedMesh.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/MeshLib/Utils/transformMeshToNodePartitionedMesh.cpp b/MeshLib/Utils/transformMeshToNodePartitionedMesh.cpp index 9eeee236a6b..c69891c5cad 100644 --- a/MeshLib/Utils/transformMeshToNodePartitionedMesh.cpp +++ b/MeshLib/Utils/transformMeshToNodePartitionedMesh.cpp @@ -257,16 +257,9 @@ std::vector<std::size_t> computeGhostBaseNodeGlobalNodeIDsOfSubDomainPartition( } // send the computed ids back - std::vector<std::size_t> computed_global_ids_for_subdomain_ghost_nodes( - global_number_of_subdomain_node_id_to_bulk_node_id); - MPI_Allreduce( - local_subdomain_node_ids_of_all_ranks.data(), /* sendbuf */ - computed_global_ids_for_subdomain_ghost_nodes - .data(), /* recvbuf (out) */ - global_number_of_subdomain_node_id_to_bulk_node_id, /* sendcount */ - MPI_UNSIGNED_LONG, /* sendtype */ - MPI_MAX, /* operation */ - mpi.communicator); + std::vector<std::size_t> const + computed_global_ids_for_subdomain_ghost_nodes = BaseLib::MPI::allreduce( + local_subdomain_node_ids_of_all_ranks, MPI_MAX, mpi); std::vector<std::size_t> global_ids_for_subdomain_ghost_nodes( computed_global_ids_for_subdomain_ghost_nodes.begin() + -- GitLab