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) {
52 ProfilingRegion ws(
"Tpetra::Distributor: doWaitsIalltofewv");
53 ialltofewv_.impl.wait(*ialltofewv_.req);
55 ialltofewv_.sendcounts.reset();
56 ialltofewv_.sdispls.reset();
57 ialltofewv_.recvcounts.reset();
58 ialltofewv_.rdispls.reset();
59 ialltofewv_.req = std::nullopt;
60 ialltofewv_.roots.clear();
65 bool DistributorActor::isReady()
const {
67 for (
auto& request : requestsRecv_) {
68 result &= request->isReady();
70 for (
auto& request : requestsSend_) {
71 result &= request->isReady();
77 #ifdef HAVE_TPETRA_MPI
78 if (ialltofewv_.req) {
80 ialltofewv_.impl.get_status(*ialltofewv_.req, &flag, MPI_STATUS_IGNORE);