Teuchos - Trilinos Tools Package Version of the Day
Public Member Functions
Teuchos::Details::MpiCommRequest Class Reference

MPI implementation of CommRequest<int>. More...

#include <Teuchos_Details_MpiCommRequest.hpp>

Inheritance diagram for Teuchos::Details::MpiCommRequest:
Teuchos::MpiCommRequestBase< int > Teuchos::CommRequest< int > Teuchos::Describable Teuchos::LabeledObject

List of all members.

Public Member Functions

 MpiCommRequest (MPI_Request rawMpiRequest, const ArrayRCP< const char > &buffer)
 Constructor.
virtual ~MpiCommRequest ()
 Destructor; cancels the request if it is still pending.

Detailed Description

MPI implementation of CommRequest<int>.

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.

The releaseRawMpiRequest() method (inherited from the base class) does not free (decrement the reference count of) the buffer, because relinquishing ownership does not actually force the nonblocking operation to complete. The destructor will free the buffer automatically.

Definition at line 70 of file Teuchos_Details_MpiCommRequest.hpp.


Constructor & Destructor Documentation

Teuchos::Details::MpiCommRequest::MpiCommRequest ( MPI_Request  rawMpiRequest,
const ArrayRCP< const char > &  buffer 
)

Constructor.

Parameters:
rawMpiRequest[in/out] Raw MPI_Request created by the nonblocking communication operation.
buffer[in] Buffer used by the nonblocking communication operation. We keep this only to delay its deallocation until after the communication operation completes. This may be null if the message length is zero or if rawMpiRequest is MPI_REQUEST_NULL.

We do not template the buffer type on the Packet type (the type of the data being communicated). You must do an rcp_reinterpret_cast on input of the buffer. We require this because this class does not need to access the buffer; it merely needs to retain a reference to prevent premature deallocation.

Definition at line 48 of file Teuchos_Details_MpiCommRequest.cpp.

Teuchos::Details::MpiCommRequest::~MpiCommRequest ( ) [virtual]

Destructor; cancels the request if it is still pending.

Definition at line 54 of file Teuchos_Details_MpiCommRequest.cpp.


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