10 #include "Tpetra_Details_DistributorActor.hpp"
12 namespace Tpetra::Details {
14 DistributorActor::DistributorActor()
15 : mpiTag_(DEFAULT_MPI_TAG) {}
17 DistributorActor::DistributorActor(
const DistributorActor& otherActor)
18 : mpiTag_(otherActor.mpiTag_),
19 requestsRecv_(otherActor.requestsRecv_),
20 requestsSend_(otherActor.requestsSend_) {}
22 void DistributorActor::doWaits(
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 if (requestsSend_.size() > 0) {
34 ProfilingRegion ws(
"Tpetra::Distributor: doWaitsSend");
36 Teuchos::waitAll(*plan.getComm(), requestsSend_());
40 requestsSend_.resize(0);
44 void DistributorActor::doWaitsRecv(
const DistributorPlan& plan) {
45 if (requestsRecv_.size() > 0) {
46 ProfilingRegion wr(
"Tpetra::Distributor: doWaitsRecv");
48 Teuchos::waitAll(*plan.getComm(), requestsRecv_());
52 requestsRecv_.resize(0);
56 void DistributorActor::doWaitsSend(
const DistributorPlan& plan) {
57 if (requestsSend_.size() > 0) {
58 ProfilingRegion ws(
"Tpetra::Distributor: doWaitsSend");
60 Teuchos::waitAll(*plan.getComm(), requestsSend_());
64 requestsSend_.resize(0);
68 bool DistributorActor::isReady()
const {
70 for (
auto& request : requestsRecv_) {
71 result &= request->isReady();
73 for (
auto& request : requestsSend_) {
74 result &= request->isReady();