Teuchos - Trilinos Tools Package Version of the Day
Public Member Functions
Teuchos::MpiCommRequest< OrdinalType > Class Template Reference

MPI implementation of CommRequest. More...

#include <Teuchos_DefaultMpiComm.hpp>

Inheritance diagram for Teuchos::MpiCommRequest< OrdinalType >:
Teuchos::CommRequest< OrdinalType > Teuchos::Describable Teuchos::LabeledObject

List of all members.

Public Member Functions

 MpiCommRequest (MPI_Request rawMpiRequest, const ArrayView< char >::size_type numBytesInMessage)
 Constructor (from a raw MPI_Request).
MPI_Request releaseRawMpiRequest ()
 Return and relinquish ownership of the raw MPI_Request.
bool isNull () const
 Whether the raw MPI_Request is MPI_REQUEST_NULL.
ArrayView< char >::size_type numBytes () const
 Number of bytes in the nonblocking send or receive request.
RCP< CommStatus< OrdinalType > > wait ()
 Wait on this communication request to complete.
RCP< CommStatus< OrdinalType > > cancel ()
 Cancel the communication request, and return its status.
 ~MpiCommRequest ()
 Destructor; cancels the request if it is still pending.

Detailed Description

template<class OrdinalType>
class Teuchos::MpiCommRequest< OrdinalType >

MPI implementation of CommRequest.

Template Parameters:
OrdinalTypeSame as the template parameter of Comm.

This class wraps MPI_Request, which is MPI's reification of a nonblocking communication operation.

Users would not normally create an instance of this class. Calls to nonblocking communication operations (such as ireceive() or isend()) return a pointer to a CommRequest. If the Comm is an MpiComm, then the returned CommRequest is an MpiCommRequest.

Users might wish to create an MpiCommRequest directly if they want to encapsulate an MPI_Request returned by an external library or by their own code.

Definition at line 181 of file Teuchos_DefaultMpiComm.hpp.


Constructor & Destructor Documentation

template<class OrdinalType >
Teuchos::MpiCommRequest< OrdinalType >::MpiCommRequest ( MPI_Request  rawMpiRequest,
const ArrayView< char >::size_type  numBytesInMessage 
) [inline]

Constructor (from a raw MPI_Request).

Definition at line 184 of file Teuchos_DefaultMpiComm.hpp.

template<class OrdinalType >
Teuchos::MpiCommRequest< OrdinalType >::~MpiCommRequest ( ) [inline]

Destructor; cancels the request if it is still pending.

Definition at line 261 of file Teuchos_DefaultMpiComm.hpp.


Member Function Documentation

template<class OrdinalType >
MPI_Request Teuchos::MpiCommRequest< OrdinalType >::releaseRawMpiRequest ( ) [inline]

Return and relinquish ownership of the raw MPI_Request.

"Relinquish ownership" means that this object sets its raw MPI_Request to MPI_REQUEST_NULL, but returns the original MPI_Request. This effectively gives the caller ownership of the raw MPI_Request. This prevents hanging requests.

Definition at line 195 of file Teuchos_DefaultMpiComm.hpp.

template<class OrdinalType >
bool Teuchos::MpiCommRequest< OrdinalType >::isNull ( ) const [inline]

Whether the raw MPI_Request is MPI_REQUEST_NULL.

Definition at line 203 of file Teuchos_DefaultMpiComm.hpp.

template<class OrdinalType >
ArrayView<char>::size_type Teuchos::MpiCommRequest< OrdinalType >::numBytes ( ) const [inline]

Number of bytes in the nonblocking send or receive request.

Remembering this is inexpensive, and is also useful for debugging (e.g., for detecting whether the send and receive have matching message lengths).

Definition at line 212 of file Teuchos_DefaultMpiComm.hpp.

template<class OrdinalType >
RCP<CommStatus<OrdinalType> > Teuchos::MpiCommRequest< OrdinalType >::wait ( ) [inline, virtual]

Wait on this communication request to complete.

This is a blocking operation. The user is responsible for avoiding deadlock. (For example, a receive must have a matching send, otherwise a wait on the receive will wait forever.)

Implements Teuchos::CommRequest< OrdinalType >.

Definition at line 221 of file Teuchos_DefaultMpiComm.hpp.

template<class OrdinalType >
RCP<CommStatus<OrdinalType> > Teuchos::MpiCommRequest< OrdinalType >::cancel ( ) [inline]

Cancel the communication request, and return its status.

If this request is invalid or has already been invalidated, this method returns null.

Definition at line 237 of file Teuchos_DefaultMpiComm.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines