From: Peter Munch Date: Sun, 11 Feb 2024 22:43:59 +0000 (+0100) Subject: ConsensusAlgorithmsPayload: switch internal data type X-Git-Tag: relicensing~49^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6eec835c1cfcf26f9feccadc8da5c1316395e35d;p=dealii.git ConsensusAlgorithmsPayload: switch internal data type --- diff --git a/include/deal.II/base/mpi_compute_index_owner_internal.h b/include/deal.II/base/mpi_compute_index_owner_internal.h index c5fb582b13..8ee2f963b4 100644 --- a/include/deal.II/base/mpi_compute_index_owner_internal.h +++ b/include/deal.II/base/mpi_compute_index_owner_internal.h @@ -282,7 +282,8 @@ namespace Utilities */ std::vector>>>> + std::vector>>>> requesters; /** @@ -366,10 +367,11 @@ namespace Utilities * therefore only need to append at the end. */ void - append_index_origin(const unsigned int index_within_dictionary, - const unsigned int rank_of_request, - const unsigned int rank_of_owner, - unsigned int &owner_index_guess); + append_index_origin( + const types::global_dof_index index_within_dictionary, + const unsigned int rank_of_request, + const unsigned int rank_of_owner, + unsigned int &owner_index_guess); }; /* ------------------------- inline functions ----------------------- */ diff --git a/source/base/mpi_compute_index_owner_internal.cc b/source/base/mpi_compute_index_owner_internal.cc index e31a8760cc..01392dc80b 100644 --- a/source/base/mpi_compute_index_owner_internal.cc +++ b/source/base/mpi_compute_index_owner_internal.cc @@ -606,7 +606,8 @@ namespace Utilities // sent in total can be deduced both via the MPI status message at // the receiver site as well as be counting the buckets from // different requesters. - std::vector> send_data(requesters.size()); + std::vector> send_data( + requesters.size()); for (unsigned int i = 0; i < requesters.size(); ++i) { // special code for our own indices @@ -636,13 +637,15 @@ namespace Utilities } } send_requests.push_back(MPI_Request()); - const int ierr = MPI_Isend(send_data[i].data(), - send_data[i].size(), - MPI_UNSIGNED, - dict.actually_owning_rank_list[i], - mpi_tag, - comm, - &send_requests.back()); + const int ierr = + MPI_Isend(send_data[i].data(), + send_data[i].size(), + Utilities::MPI::mpi_type_id_for_type< + types::global_dof_index>, + dict.actually_owning_rank_list[i], + mpi_tag, + comm, + &send_requests.back()); AssertThrowMPI(ierr); } } @@ -657,20 +660,25 @@ namespace Utilities // retrieve size of incoming message int number_amount; - ierr = MPI_Get_count(&status, MPI_UNSIGNED, &number_amount); + ierr = MPI_Get_count( + &status, + Utilities::MPI::mpi_type_id_for_type, + &number_amount); AssertThrowMPI(ierr); // receive message Assert(number_amount % 2 == 0, ExcInternalError()); - std::vector> buffer( - number_amount / 2); - ierr = MPI_Recv(buffer.data(), - number_amount, - MPI_UNSIGNED, - status.MPI_SOURCE, - status.MPI_TAG, - comm, - &status); + std::vector< + std::pair> + buffer(number_amount / 2); + ierr = MPI_Recv( + buffer.data(), + number_amount, + Utilities::MPI::mpi_type_id_for_type, + status.MPI_SOURCE, + status.MPI_TAG, + comm, + &status); AssertThrowMPI(ierr); // unpack the message and translate the dictionary-local @@ -733,10 +741,10 @@ namespace Utilities void ConsensusAlgorithmsPayload::append_index_origin( - const unsigned int index_within_dict, - const unsigned int rank_of_request, - const unsigned int rank_of_owner, - unsigned int &owner_index_guess) + const types::global_dof_index index_within_dict, + const unsigned int rank_of_request, + const unsigned int rank_of_owner, + unsigned int &owner_index_guess) { // remember who requested which index. We want to use an // std::vector with simple addressing, via a good guess from the @@ -749,7 +757,8 @@ namespace Utilities if (request.empty() || request.back().first != rank_of_request) request.emplace_back( rank_of_request, - std::vector>()); + std::vector< + std::pair>()); auto &intervals = request.back().second; if (intervals.empty() || intervals.back().second != index_within_dict)