Kokkos Node API and Local Linear Algebra Kernels Version of the Day
Public Member Functions
TSQR::TeuchosMessenger< Datum > Class Template Reference

Communication object for TSQR. More...

#include <Tsqr_TeuchosMessenger.hpp>

Inheritance diagram for TSQR::TeuchosMessenger< Datum >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 TeuchosMessenger (const comm_ptr &pComm)
 Constructor, taking the communicator object to wrap.
virtual ~TeuchosMessenger ()
 Virtual destructor for memory safety of derived classes.
void send (const Datum sendData[], const int sendCount, const int destProc, const int tag)
 Send sendData[0:sendCount-1] to process destProc.
void recv (Datum recvData[], const int recvCount, const int srcProc, const int tag)
 Receive recvData[0:recvCount-1] from process srcProc.
void swapData (const Datum sendData[], Datum recvData[], const int sendRecvCount, const int destProc, const int tag)
Datum globalSum (const Datum &inDatum)
 Sum inDatum on all processors, and return the result.
Datum globalMin (const Datum &inDatum)
 Compute the global minimum over all processors.
Datum globalMax (const Datum &inDatum)
 Compute the global maximum over all processors.
void globalVectorSum (const Datum inData[], Datum outData[], const int count)
 Sum inData[0:count-1] over all processors into outData.
void broadcast (Datum data[], const int count, const int root)
 Broadcast data[0:count-1] from root to all processors.
int rank () const
 Return this process' rank.
int size () const
 Return the total number of ranks in the communicator.
void barrier () const
 Execute a barrier over the communicator.

Detailed Description

template<class Datum>
class TSQR::TeuchosMessenger< Datum >

Communication object for TSQR.

A thin wrapper around Teuchos::Comm<int>, for use by TSQR. The internode parallel part of TSQR communicates via a MessengerBase<Datum> interface. TeuchosMessenger<Datum> implements that interface by wrapping Teuchos::Comm<int>.

Template Parameters:
DatumA class with value-type semantics, whose instances are less-than comparable.

Definition at line 64 of file Tsqr_TeuchosMessenger.hpp.


Constructor & Destructor Documentation

template<class Datum >
TSQR::TeuchosMessenger< Datum >::TeuchosMessenger ( const comm_ptr pComm) [inline]

Constructor, taking the communicator object to wrap.

Definition at line 69 of file Tsqr_TeuchosMessenger.hpp.

template<class Datum >
virtual TSQR::TeuchosMessenger< Datum >::~TeuchosMessenger ( ) [inline, virtual]

Virtual destructor for memory safety of derived classes.

Definition at line 72 of file Tsqr_TeuchosMessenger.hpp.


Member Function Documentation

template<class Datum >
void TSQR::TeuchosMessenger< Datum >::send ( const Datum  sendData[],
const int  sendCount,
const int  destProc,
const int  tag 
) [inline, virtual]

Send sendData[0:sendCount-1] to process destProc.

Parameters:
sendData[in] Array of value-type elements to send
sendCount[in] Number of elements in the array
destProc[in] Rank of destination process
tag[in] MPI tag (ignored)

Implements TSQR::MessengerBase< Datum >.

Definition at line 81 of file Tsqr_TeuchosMessenger.hpp.

template<class Datum >
void TSQR::TeuchosMessenger< Datum >::recv ( Datum  recvData[],
const int  recvCount,
const int  srcProc,
const int  tag 
) [inline, virtual]

Receive recvData[0:recvCount-1] from process srcProc.

Parameters:
recvData[out] Array of value-type elements to receive
recvCount[in] Number of elements to receive in the array
srcProc[in] Rank of sending process
tag[in] MPI tag (ignored)

Implements TSQR::MessengerBase< Datum >.

Definition at line 99 of file Tsqr_TeuchosMessenger.hpp.

template<class Datum >
void TSQR::TeuchosMessenger< Datum >::swapData ( const Datum  sendData[],
Datum  recvData[],
const int  sendRecvCount,
const int  destProc,
const int  tag 
) [inline, virtual]

Exchange sencRecvCount elements of sendData with processor destProc, receiving the result into recvData. Optimize for the case that sendData and recvData do not alias one another, which is the common case for TSQR.

Warning:
This routine does only a rudimentary and incomplete check for whether sendData and recvData alias one another.
Parameters:
sendData[in] Array of value-type elements to send
recvData[out] Array of value-type elements to receive. Caller is responsible for making sure that recvData does not alias sendData.
sendRecvCount[in] Number of elements to send and receive in the array
destProc[in] The "other" process' rank (to which this process is sending data, and from which this process is receiving data)
tag[in] MPI tag (ignored)

Implements TSQR::MessengerBase< Datum >.

Definition at line 129 of file Tsqr_TeuchosMessenger.hpp.

template<class Datum >
Datum TSQR::TeuchosMessenger< Datum >::globalSum ( const Datum &  inDatum) [inline, virtual]

Sum inDatum on all processors, and return the result.

Implements TSQR::MessengerBase< Datum >.

Definition at line 213 of file Tsqr_TeuchosMessenger.hpp.

template<class Datum >
Datum TSQR::TeuchosMessenger< Datum >::globalMin ( const Datum &  inDatum) [inline, virtual]

Compute the global minimum over all processors.

Assumes that Datum objects are less-than comparable.

Implements TSQR::MessengerBase< Datum >.

Definition at line 225 of file Tsqr_TeuchosMessenger.hpp.

template<class Datum >
Datum TSQR::TeuchosMessenger< Datum >::globalMax ( const Datum &  inDatum) [inline, virtual]

Compute the global maximum over all processors.

Assumes that Datum objects are less-than comparable.

Implements TSQR::MessengerBase< Datum >.

Definition at line 237 of file Tsqr_TeuchosMessenger.hpp.

template<class Datum >
void TSQR::TeuchosMessenger< Datum >::globalVectorSum ( const Datum  inData[],
Datum  outData[],
const int  count 
) [inline, virtual]

Sum inData[0:count-1] over all processors into outData.

Implements TSQR::MessengerBase< Datum >.

Definition at line 247 of file Tsqr_TeuchosMessenger.hpp.

template<class Datum >
void TSQR::TeuchosMessenger< Datum >::broadcast ( Datum  data[],
const int  count,
const int  root 
) [inline, virtual]

Broadcast data[0:count-1] from root to all processors.

Implements TSQR::MessengerBase< Datum >.

Definition at line 257 of file Tsqr_TeuchosMessenger.hpp.

template<class Datum >
int TSQR::TeuchosMessenger< Datum >::rank ( ) const [inline, virtual]

Return this process' rank.

Implements TSQR::MessengerBase< Datum >.

Definition at line 265 of file Tsqr_TeuchosMessenger.hpp.

template<class Datum >
int TSQR::TeuchosMessenger< Datum >::size ( ) const [inline, virtual]

Return the total number of ranks in the communicator.

Implements TSQR::MessengerBase< Datum >.

Definition at line 268 of file Tsqr_TeuchosMessenger.hpp.

template<class Datum >
void TSQR::TeuchosMessenger< Datum >::barrier ( ) const [inline, virtual]

Execute a barrier over the communicator.

Implements TSQR::MessengerBase< Datum >.

Definition at line 271 of file Tsqr_TeuchosMessenger.hpp.


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