pMR API Documentation
Public Member Functions | List of all members
Target Class Reference

Backend-agnostic Target.

#include <target.hpp>

Public Member Functions

 Target (MPI_Comm const communicator, int const targetRank, int const uniqueSendID, int const uniqueRecvID)
 Convert MPI Target to backend-agnostic Target. More...
 
 Target (MPI_Comm const communicator, int const targetRank, int const uniqueSendID, int const uniqueRecvID, bool const null, bool const self)
 Convert MPI Target to backend-agnostic Target. More...
 
bool isRemote () const
 Checks whether the target is another process. More...
 
bool isNull () const
 Checks whether the target is null (MPI_PROC_NULL). More...
 
bool isSelf () const
 Checks whether the target is the same process. More...
 

Constructor & Destructor Documentation

Target ( MPI_Comm const  communicator,
int const  targetRank,
int const  uniqueSendID,
int const  uniqueRecvID 
)
Parameters
communicatorMPI Communicator.
targetRankTarget MPI rank.
uniqueSendIDUnique ID to distiguish MPI messages (Send Tag).
uniqueRecvIDUnique ID to distinguish MPI messages (Recv Tag).
Returns
Return backend-agnostic Target.
Target ( MPI_Comm const  communicator,
int const  targetRank,
int const  uniqueSendID,
int const  uniqueRecvID,
bool const  null,
bool const  self 
)
Warning
Only one of the paramteter null and self can be true.
Note
It is hardly ever required to specify the additional parameters null and self for a target. pMR is able to construct this information from source and target rank and send and receive tag.
Parameters
communicatorMPI Communicator.
targetRankTarget MPI rank.
uniqueSendIDUnique ID to distiguish MPI messages (Send Tag).
uniqueRecvIDUnique ID to distinguish MPI messages (Recv Tag).
nullTarget is no communication (MPI_PROC_NULL).
selfTarget is self communication.
Returns
Return backend-agnostic Target.

Member Function Documentation

bool isNull ( ) const
Returns
Returns true if null, false otherwise.
bool isRemote ( ) const
Returns
Returns true if another process, false otherwise.
bool isSelf ( ) const
Note
Connections to the same process may or may not require a second connection attempt by the same process.
Using only the backend-agnostic communicator the bahavior is straightforward. A connection to a Target retrieved calling getNeighbor() with a displacement not equal to zero, but still being the same process, assumes there is a second connection attempt. For all other cases, getNeighbor() with displacement of zero or getTarget() of own ID, there is no other connection attempt required.
In terms of MPI: The second is a SendRecv call with both same source and destination rank, and send and receive tag.
Returns
Returns true if self, false otherwise.