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

Noncommunicating "communication" object for TSQR. More...

#include <Tsqr_TrivialMessenger.hpp>

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

List of all members.

Public Member Functions

 TrivialMessenger ()
 Trivial / default constructor, since no member data.
virtual ~TrivialMessenger ()
 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)
 Exchange data between processors.
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::TrivialMessenger< Datum >

Noncommunicating "communication" object for TSQR.

The internode parallel part of TSQR communicates via a MessengerBase<Datum> interface. TrivialMessenger<Datum> implements that interface by acting as if running on MPI with only one rank, though it doesn't require MPI support to build.

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

Definition at line 53 of file Tsqr_TrivialMessenger.hpp.


Constructor & Destructor Documentation

template<class Datum >
TSQR::TrivialMessenger< Datum >::TrivialMessenger ( ) [inline]

Trivial / default constructor, since no member data.

Definition at line 56 of file Tsqr_TrivialMessenger.hpp.

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

Virtual destructor for memory safety of derived classes.

Definition at line 59 of file Tsqr_TrivialMessenger.hpp.


Member Function Documentation

template<class Datum >
void TSQR::TrivialMessenger< 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 68 of file Tsqr_TrivialMessenger.hpp.

template<class Datum >
void TSQR::TrivialMessenger< 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 81 of file Tsqr_TrivialMessenger.hpp.

template<class Datum >
void TSQR::TrivialMessenger< Datum >::swapData ( const Datum  sendData[],
Datum  recvData[],
const int  sendRecvCount,
const int  destProc,
const int  tag 
) [inline, 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)

Implements TSQR::MessengerBase< Datum >.

Definition at line 104 of file Tsqr_TrivialMessenger.hpp.

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

Sum inDatum on all processors, and return the result.

Implements TSQR::MessengerBase< Datum >.

Definition at line 132 of file Tsqr_TrivialMessenger.hpp.

template<class Datum >
Datum TSQR::TrivialMessenger< 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 142 of file Tsqr_TrivialMessenger.hpp.

template<class Datum >
Datum TSQR::TrivialMessenger< 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 152 of file Tsqr_TrivialMessenger.hpp.

template<class Datum >
void TSQR::TrivialMessenger< 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 160 of file Tsqr_TrivialMessenger.hpp.

template<class Datum >
void TSQR::TrivialMessenger< 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 169 of file Tsqr_TrivialMessenger.hpp.

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

Return this process' rank.

Implements TSQR::MessengerBase< Datum >.

Definition at line 175 of file Tsqr_TrivialMessenger.hpp.

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

Return the total number of ranks in the communicator.

Implements TSQR::MessengerBase< Datum >.

Definition at line 178 of file Tsqr_TrivialMessenger.hpp.

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

Execute a barrier over the communicator.

Implements TSQR::MessengerBase< Datum >.

Definition at line 181 of file Tsqr_TrivialMessenger.hpp.


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