From: Wolfgang Bangerth Date: Fri, 8 Jul 2022 23:38:08 +0000 (-0600) Subject: Simplify some MPI code. X-Git-Tag: v9.5.0-rc1~1102^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=67c4daac90be22c6d0e2bac2bb28c0add60e71b6;p=dealii.git Simplify some MPI code. --- diff --git a/source/multigrid/mg_transfer_internal.cc b/source/multigrid/mg_transfer_internal.cc index e5357ac76c..f442e6b9e6 100644 --- a/source/multigrid/mg_transfer_internal.cc +++ b/source/multigrid/mg_transfer_internal.cc @@ -291,31 +291,16 @@ namespace internal { requests.push_back(MPI_Request()); std::vector &data = send_data[dest]; - // If there is nothing to send, we still need to send a message, - // because the receiving end will be waitng. In that case we - // just send an empty message. - if (data.size()) - { - const int ierr = MPI_Isend(data.data(), - data.size() * sizeof(data[0]), - MPI_BYTE, - dest, - mpi_tag, - tria->get_communicator(), - &*requests.rbegin()); - AssertThrowMPI(ierr); - } - else - { - const int ierr = MPI_Isend(nullptr, - 0, - MPI_BYTE, - dest, - mpi_tag, - tria->get_communicator(), - &*requests.rbegin()); - AssertThrowMPI(ierr); - } + + const int ierr = + MPI_Isend(data.data(), + data.size() * sizeof(decltype(*data.data())), + MPI_BYTE, + dest, + mpi_tag, + tria->get_communicator(), + &*requests.rbegin()); + AssertThrowMPI(ierr); } }