Tpetra parallel linear algebra  Version of the Day
Public Member Functions | List of all members
Tpetra::Details::Impl::DeferredActionCommRequest Class Reference

Part of the Work-around for not having MPI >= 3. More...

#include <Tpetra_Details_iallreduce.hpp>

Inheritance diagram for Tpetra::Details::Impl::DeferredActionCommRequest:
Inheritance graph
[legend]

Public Member Functions

 DeferredActionCommRequest ()
 Default constructor (take no action on wait). More...
 
 DeferredActionCommRequest (std::function< void() > action)
 Constructor that takes an action to defer. More...
 
void wait ()
 Wait on this communication request to complete. More...
 
void cancel ()
 Cancel the pending communication request, without taking the specified action. More...
 

Detailed Description

Part of the Work-around for not having MPI >= 3.

Substitute for MPI_Iallreduce (which requires MPI 3): defer calling MPI_Allreduce until wait. It's ugly, but it works.

Definition at line 165 of file Tpetra_Details_iallreduce.hpp.

Constructor & Destructor Documentation

◆ DeferredActionCommRequest() [1/2]

Tpetra::Details::Impl::DeferredActionCommRequest::DeferredActionCommRequest ( )

Default constructor (take no action on wait).

Definition at line 177 of file Tpetra_Details_iallreduce.cpp.

◆ DeferredActionCommRequest() [2/2]

Tpetra::Details::Impl::DeferredActionCommRequest::DeferredActionCommRequest ( std::function< void() >  action)

Constructor that takes an action to defer.

action [in] An action to take on wait().

We only take that action the first time you call wait(). This means that wait() is idempotent.

Definition at line 183 of file Tpetra_Details_iallreduce.cpp.

Member Function Documentation

◆ wait()

void Tpetra::Details::Impl::DeferredActionCommRequest::wait ( )
virtual

Wait on this communication request to complete.

Implements Tpetra::Details::CommRequest.

Definition at line 190 of file Tpetra_Details_iallreduce.cpp.

◆ cancel()

void Tpetra::Details::Impl::DeferredActionCommRequest::cancel ( )
virtual

Cancel the pending communication request, without taking the specified action.

Subsequent calls to wait() do nothing.

Implements Tpetra::Details::CommRequest.

Definition at line 200 of file Tpetra_Details_iallreduce.cpp.


The documentation for this class was generated from the following files: