10#include "Tpetra_Details_DistributorActor.hpp"
14DistributorActor::DistributorActor()
15 : mpiTag_(DEFAULT_MPI_TAG)
16 , ialltofewvRootTag_(DEFAULT_MPI_TAG) {}
18void DistributorActor::doWaits(
const DistributorPlan& plan) {
23void DistributorActor::doWaitsRecv(
const DistributorPlan& plan) {
24 if (requestsRecv_.size() > 0) {
25 ProfilingRegion wr(
"Tpetra::Distributor::doWaitsRecv");
27 Teuchos::waitAll(*plan.getComm(), requestsRecv_());
31 requestsRecv_.resize(0);
34 doWaitsIalltofewv(plan);
37void DistributorActor::doWaitsSend(
const DistributorPlan& plan) {
38 if (requestsSend_.size() > 0) {
39 ProfilingRegion ws(
"Tpetra::Distributor::doWaitsSend");
41 Teuchos::waitAll(*plan.getComm(), requestsSend_());
45 requestsSend_.resize(0);
49void DistributorActor::doWaitsIalltofewv(
const DistributorPlan& plan) {
51 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();
65bool DistributorActor::isReady()
const {
67 for (
auto& request : requestsRecv_) {
68 result &= request->isReady();
70 for (
auto& request : requestsSend_) {
71 result &= request->isReady();
78 if (ialltofewv_.req) {
80 ialltofewv_.impl.get_status(*ialltofewv_.req, &flag, MPI_STATUS_IGNORE);
Nonmember function that computes a residual Computes R = B - A * X.