From: Wolfgang Bangerth Date: Thu, 13 Jan 2022 04:49:26 +0000 (-0700) Subject: Rename a couple of member variables to better reflect their purpose. X-Git-Tag: v9.4.0-rc1~609^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97b184b62b73e224d3862a48e37a6be8ac71465c;p=dealii.git Rename a couple of member variables to better reflect their purpose. --- diff --git a/include/deal.II/base/mpi_consensus_algorithms.h b/include/deal.II/base/mpi_consensus_algorithms.h index 38111dd31e..36a68fbc75 100644 --- a/include/deal.II/base/mpi_consensus_algorithms.h +++ b/include/deal.II/base/mpi_consensus_algorithms.h @@ -466,8 +466,11 @@ namespace Utilities /** * Requests for sending requests and receiving answers to requests. + * The first half of the array is used for the receive-answer + * requests objects, the second half for the send-request request + * objects. */ - std::vector send_and_recv_buffers; + std::vector send_request_and_recv_answer_requests; /** * Buffers for sending answers to requests. @@ -477,7 +480,7 @@ namespace Utilities /** * Requests for sending answers to requests. */ - std::vector requests_answers; + std::vector send_answer_requests; #endif /** * List of processes who have made a request to this process. diff --git a/include/deal.II/base/mpi_consensus_algorithms.templates.h b/include/deal.II/base/mpi_consensus_algorithms.templates.h index 81a2941cdc..fed4329d32 100644 --- a/include/deal.II/base/mpi_consensus_algorithms.templates.h +++ b/include/deal.II/base/mpi_consensus_algorithms.templates.h @@ -445,9 +445,9 @@ namespace Utilities // 2) allocate memory recv_buffers.resize(n_targets); send_buffers.resize(n_targets); - send_and_recv_buffers.resize(2 * n_targets); + send_request_and_recv_answer_requests.resize(2 * n_targets); - requests_answers.resize(n_sources); + send_answer_requests.resize(n_sources); requests_buffers.resize(n_sources); // 4) send and receive @@ -461,13 +461,14 @@ namespace Utilities this->process.create_request(rank, send_buffer); // start to send data - auto ierr = MPI_Isend(send_buffer.data(), - send_buffer.size() * sizeof(T1), - MPI_BYTE, - rank, - tag_request, - this->comm, - &send_and_recv_buffers[n_targets + i]); + auto ierr = + MPI_Isend(send_buffer.data(), + send_buffer.size() * sizeof(T1), + MPI_BYTE, + rank, + tag_request, + this->comm, + &send_request_and_recv_answer_requests[n_targets + i]); AssertThrowMPI(ierr); // start to receive data @@ -479,7 +480,7 @@ namespace Utilities rank, tag_deliver, this->comm, - &send_and_recv_buffers[i]); + &send_request_and_recv_answer_requests[i]); AssertThrowMPI(ierr); } @@ -543,7 +544,7 @@ namespace Utilities other_rank, tag_deliver, this->comm, - &requests_answers[index]); + &send_answer_requests[index]); AssertThrowMPI(ierr); #else (void)index; @@ -557,20 +558,23 @@ namespace Utilities PEX::clean_up_and_end_communication() { #ifdef DEAL_II_WITH_MPI - // finalize all MPI_Requests - if (send_and_recv_buffers.size() > 0) + // Finalize all MPI_Request objects for both the + // send-request and receive-answer operations. + if (send_request_and_recv_answer_requests.size() > 0) { - auto ierr = MPI_Waitall(send_and_recv_buffers.size(), - send_and_recv_buffers.data(), - MPI_STATUSES_IGNORE); + const int ierr = + MPI_Waitall(send_request_and_recv_answer_requests.size(), + send_request_and_recv_answer_requests.data(), + MPI_STATUSES_IGNORE); AssertThrowMPI(ierr); } - if (requests_answers.size() > 0) + // Then also check the send-answer requests. + if (send_answer_requests.size() > 0) { - auto ierr = MPI_Waitall(requests_answers.size(), - requests_answers.data(), - MPI_STATUSES_IGNORE); + const int ierr = MPI_Waitall(send_answer_requests.size(), + send_answer_requests.data(), + MPI_STATUSES_IGNORE); AssertThrowMPI(ierr); }