10 #include "Tpetra_Details_DistributorActor.hpp"
11 #include "Teuchos_TimeMonitor.hpp"
16 DistributorActor::DistributorActor()
17 : mpiTag_(DEFAULT_MPI_TAG)
19 #ifdef HAVE_TPETRA_DISTRIBUTOR_TIMINGS
21 #endif // HAVE_TPETRA_DISTRIBUTOR_TIMINGS
24 DistributorActor::DistributorActor(
const DistributorActor& otherActor)
25 : mpiTag_(otherActor.mpiTag_),
26 requests_(otherActor.requests_)
28 #ifdef HAVE_TPETRA_DISTRIBUTOR_TIMINGS
30 #endif // HAVE_TPETRA_DISTRIBUTOR_TIMINGS
33 void DistributorActor::doWaits(
const DistributorPlan& plan) {
34 #ifdef HAVE_TPETRA_DISTRIBUTOR_TIMINGS
35 Teuchos::TimeMonitor timeMon (*timer_doWaits_);
36 #endif // HAVE_TPETRA_DISTRIBUTOR_TIMINGS
38 if (requests_.size() > 0) {
39 Teuchos::waitAll(*plan.getComm(), requests_());
47 bool DistributorActor::isReady()
const {
49 for (
auto& request : requests_) {
50 result &= request->isReady();
55 #ifdef HAVE_TPETRA_DISTRIBUTOR_TIMINGS
56 void DistributorActor::makeTimers () {
57 timer_doWaits_ = Teuchos::TimeMonitor::getNewTimer (
58 "Tpetra::Distributor: doWaits");
60 timer_doPosts3KV_ = Teuchos::TimeMonitor::getNewTimer (
61 "Tpetra::Distributor: doPosts(3) KV");
62 timer_doPosts4KV_ = Teuchos::TimeMonitor::getNewTimer (
63 "Tpetra::Distributor: doPosts(4) KV");
65 timer_doPosts3KV_recvs_ = Teuchos::TimeMonitor::getNewTimer (
66 "Tpetra::Distributor: doPosts(3): recvs KV");
67 timer_doPosts4KV_recvs_ = Teuchos::TimeMonitor::getNewTimer (
68 "Tpetra::Distributor: doPosts(4): recvs KV");
70 timer_doPosts3KV_barrier_ = Teuchos::TimeMonitor::getNewTimer (
71 "Tpetra::Distributor: doPosts(3): barrier KV");
72 timer_doPosts4KV_barrier_ = Teuchos::TimeMonitor::getNewTimer (
73 "Tpetra::Distributor: doPosts(4): barrier KV");
75 timer_doPosts3KV_sends_ = Teuchos::TimeMonitor::getNewTimer (
76 "Tpetra::Distributor: doPosts(3): sends KV");
77 timer_doPosts4KV_sends_ = Teuchos::TimeMonitor::getNewTimer (
78 "Tpetra::Distributor: doPosts(4): sends KV");
79 timer_doPosts3KV_sends_slow_ = Teuchos::TimeMonitor::getNewTimer (
80 "Tpetra::Distributor: doPosts(3): sends KV SLOW");
81 timer_doPosts4KV_sends_slow_ = Teuchos::TimeMonitor::getNewTimer (
82 "Tpetra::Distributor: doPosts(4): sends KV SLOW");
83 timer_doPosts3KV_sends_fast_ = Teuchos::TimeMonitor::getNewTimer (
84 "Tpetra::Distributor: doPosts(3): sends KV FAST");
85 timer_doPosts4KV_sends_fast_ = Teuchos::TimeMonitor::getNewTimer (
86 "Tpetra::Distributor: doPosts(4): sends KV FAST");
88 #endif // HAVE_TPETRA_DISTRIBUTOR_TIMINGS