10 #include "Tpetra_Details_DistributorActor.hpp"
12 namespace Tpetra::Details {
14 DistributorActor::DistributorActor()
15 : mpiTag_(DEFAULT_MPI_TAG) {}
17 void DistributorActor::doWaits(
const DistributorPlan& plan) {
22 void DistributorActor::doWaitsRecv(
const DistributorPlan& plan) {
23 if (requestsRecv_.size() > 0) {
24 ProfilingRegion wr(
"Tpetra::Distributor::doWaitsRecv");
26 Teuchos::waitAll(*plan.getComm(), requestsRecv_());
30 requestsRecv_.resize(0);
33 doWaitsIalltofewv(plan);
36 void DistributorActor::doWaitsSend(
const DistributorPlan& plan) {
37 if (requestsSend_.size() > 0) {
38 ProfilingRegion ws(
"Tpetra::Distributor::doWaitsSend");
40 Teuchos::waitAll(*plan.getComm(), requestsSend_());
44 requestsSend_.resize(0);
48 void DistributorActor::doWaitsIalltofewv(
const DistributorPlan& plan) {
49 #ifdef HAVE_TPETRA_MPI
50 if (ialltofewv_.req) {
51 ProfilingRegion ws(
"Tpetra::Distributor::doWaitsIalltofewv");
52 ialltofewv_.impl.wait(*ialltofewv_.req);
54 ialltofewv_.sendcounts.reset();
55 ialltofewv_.sdispls.reset();
56 ialltofewv_.recvcounts.reset();
57 ialltofewv_.rdispls.reset();
58 ialltofewv_.req = std::nullopt;
59 ialltofewv_.roots.clear();
64 bool DistributorActor::isReady()
const {
66 for (
auto& request : requestsRecv_) {
67 result &= request->isReady();
69 for (
auto& request : requestsSend_) {
70 result &= request->isReady();
76 #ifdef HAVE_TPETRA_MPI
77 if (ialltofewv_.req) {
79 ialltofewv_.impl.get_status(*ialltofewv_.req, &flag, MPI_STATUS_IGNORE);