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

#include <Tsqr_MessengerBase.hpp>

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

List of all members.

Public Member Functions

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

Detailed Description

template<class Datum>
class TSQR::MessengerBase< Datum >

Interface for an object that performs collective communication. Each message contains some number of objects of scalar type Datum. Datum must have a default constructor and a copy constructor, and taking its address must make sense (in terms of extracting the useful data).

Definition at line 44 of file Tsqr_MessengerBase.hpp.


Constructor & Destructor Documentation

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

Virtual destructor for memory safety of derived classes.

Definition at line 47 of file Tsqr_MessengerBase.hpp.


Member Function Documentation

template<class Datum>
virtual void TSQR::MessengerBase< Datum >::send ( const Datum  sendData[],
const int  sendCount,
const int  destProc,
const int  tag 
) [pure 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)

Implemented in TSQR::TeuchosMessenger< Datum >, and TSQR::TrivialMessenger< Datum >.

template<class Datum>
virtual void TSQR::MessengerBase< Datum >::recv ( Datum  recvData[],
const int  recvCount,
const int  srcProc,
const int  tag 
) [pure 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)

Implemented in TSQR::TeuchosMessenger< Datum >, and TSQR::TrivialMessenger< Datum >.

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

Exchange data between processors.

Exchange sencRecvCount elements of sendData with processor destProc, receiving the result into recvData. Assume that sendData and recvData do not 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)

Implemented in TSQR::TeuchosMessenger< Datum >, and TSQR::TrivialMessenger< Datum >.

template<class Datum>
virtual Datum TSQR::MessengerBase< Datum >::globalSum ( const Datum &  inDatum) [pure virtual]

Sum inDatum on all processors, and return the result.

Implemented in TSQR::TeuchosMessenger< Datum >, and TSQR::TrivialMessenger< Datum >.

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

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

Implemented in TSQR::TeuchosMessenger< Datum >, and TSQR::TrivialMessenger< Datum >.

template<class Datum>
virtual Datum TSQR::MessengerBase< Datum >::globalMin ( const Datum &  inDatum) [pure virtual]

Compute the global minimum over all processors.

Assumes that Datum objects are less-than comparable.

Implemented in TSQR::TeuchosMessenger< Datum >, and TSQR::TrivialMessenger< Datum >.

template<class Datum>
virtual Datum TSQR::MessengerBase< Datum >::globalMax ( const Datum &  inDatum) [pure virtual]

Compute the global maximum over all processors.

Assumes that Datum objects are less-than comparable.

Implemented in TSQR::TeuchosMessenger< Datum >, and TSQR::TrivialMessenger< Datum >.

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

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

Implemented in TSQR::TeuchosMessenger< Datum >, and TSQR::TrivialMessenger< Datum >.

template<class Datum>
virtual int TSQR::MessengerBase< Datum >::rank ( ) const [pure virtual]

Return this process' rank.

Implemented in TSQR::TeuchosMessenger< Datum >, and TSQR::TrivialMessenger< Datum >.

template<class Datum>
virtual int TSQR::MessengerBase< Datum >::size ( ) const [pure virtual]

Return the total number of ranks in the communicator.

Implemented in TSQR::TeuchosMessenger< Datum >, and TSQR::TrivialMessenger< Datum >.

template<class Datum>
virtual void TSQR::MessengerBase< Datum >::barrier ( ) const [pure virtual]

Execute a barrier over the communicator.

Implemented in TSQR::TeuchosMessenger< Datum >, and TSQR::TrivialMessenger< Datum >.


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