Tpetra::Comm< OrdinalType, PacketType > Class Template Reference

Tpetra::Comm: The Tpetra Communication Abstract Base Class. More...

#include <Tpetra_Comm.hpp>

Inheritance diagram for Tpetra::Comm< OrdinalType, PacketType >:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual ~Comm ()
 Destructor.
virtual void barrier () const =0
 Barrier.
virtual void broadcast (PacketType *myVals, OrdinalType const count, int const root) const =0
 Broadcast.
virtual void gatherAll (PacketType *myVals, PacketType *allVals, OrdinalType const count) const =0
 Gather All function.
virtual void sumAll (PacketType *partialSums, PacketType *globalSums, OrdinalType const count) const =0
 Global Sum function.
virtual void sumAllAndScatter (PacketType *sendVals, PacketType *recvVals, OrdinalType *recvCounts) const =0
 Scattered Global Sum function.
virtual void maxAll (PacketType *partialMaxs, PacketType *globalMaxs, OrdinalType const count) const =0
 Global Max function.
virtual void minAll (PacketType *partialMins, PacketType *globalMins, OrdinalType const count) const =0
 Global Min function.
virtual void scanSum (PacketType *myVals, PacketType *scanSums, OrdinalType const count) const =0
 Scan Sum function.
virtual void send (PacketType *myVals, OrdinalType const count, int destImageID) const =0
 Blocking Send function.
virtual int receive (PacketType *myVals, OrdinalType const count, int sourceImageID) const =0
 Blocking Receive function.
virtual void doPostsAndWaits (Distributor< OrdinalType > const &distributor, std::vector< PacketType > &exports, OrdinalType packetSize, std::vector< PacketType > &imports)=0
 doPostsAndWaits
virtual void doPosts (Distributor< OrdinalType > const &distributor, std::vector< PacketType > &exports, OrdinalType packetSize, std::vector< PacketType > &imports)=0
 doPosts
virtual void doWaits (Distributor< OrdinalType > const &distributor)=0
 doWaits
virtual void doReversePostsAndWaits (Distributor< OrdinalType > const &distributor, std::vector< PacketType > &exports, OrdinalType packetSize, std::vector< PacketType > &imports)=0
 doReversePostsAndWaits
virtual void doReversePosts (Distributor< OrdinalType > const &distributor, std::vector< PacketType > &exports, OrdinalType packetSize, std::vector< PacketType > &imports)=0
 doReversePosts
virtual void doReverseWaits (Distributor< OrdinalType > const &distributor)=0
 doReverseWaits
virtual int getMyImageID () const =0
 getMyImageID - returns my rank on this machine
virtual int getNumImages () const =0
 getNumImages - returns the number of images on this machine
virtual void printInfo (ostream &os) const =0
 printInfo

Detailed Description

template<typename OrdinalType, typename PacketType>
class Tpetra::Comm< OrdinalType, PacketType >

Tpetra::Comm: The Tpetra Communication Abstract Base Class.

The Tpetra Comm class is an interface that encapsulates the general information and services needed for other Tpetra classes to run on a parallel computer.

Comm currently has two default implementations, via SerialComm and MpiComm, for both serial execution and MPI distributed memory execution. It is meant to insulate the user from the specifics of communication that are not required for normal manipulation of linear algebra objects. Most Comm interfaces are similar to MPI interfaces, except that the type of data is not required as an argument since C++ can bind to the appropriate interface based on argument typing.


Member Function Documentation

template<typename OrdinalType, typename PacketType>
virtual void Tpetra::Comm< OrdinalType, PacketType >::barrier (  )  const [pure virtual]

Barrier.

Each image must stop until all images have reached the barrier.

Implemented in Tpetra::MpiComm< OrdinalType, PacketType >, and Tpetra::SerialComm< OrdinalType, PacketType >.

template<typename OrdinalType, typename PacketType>
virtual void Tpetra::Comm< OrdinalType, PacketType >::broadcast ( PacketType *  myVals,
OrdinalType const   count,
int const   root 
) const [pure virtual]

Broadcast.

Take list of input values from the root image and sends to all other images.

Parameters:
myVals InOut On entry, the root image contains the list of values. On exit, all images will have the same list of values. Note that values must be allocated on all images before the broadcast.
count In On entry, contains the length of myVals.
root In On entry, contains the imageID from which all images will receive a copy of myVals.

Implemented in Tpetra::MpiComm< OrdinalType, PacketType >, and Tpetra::SerialComm< OrdinalType, PacketType >.

template<typename OrdinalType, typename PacketType>
virtual void Tpetra::Comm< OrdinalType, PacketType >::doPostsAndWaits ( Distributor< OrdinalType > const &  distributor,
std::vector< PacketType > &  exports,
OrdinalType  packetSize,
std::vector< PacketType > &  imports 
) [pure virtual]

doPostsAndWaits

Execute a plan specified by the distributor object passed in.

Parameters:
distributor In Contains the specifications of the plan we're executing.
exports In On entry, contains the values we're exporting.
packetSize In On entry, the number of PacketType variables that make up an element.
imports Out On exit, contains the values exported to us. (imports will be resized if necessary, and any existing values will be overwritten.)

Implemented in Tpetra::MpiComm< OrdinalType, PacketType >, and Tpetra::SerialComm< OrdinalType, PacketType >.

template<typename OrdinalType, typename PacketType>
virtual void Tpetra::Comm< OrdinalType, PacketType >::doReversePostsAndWaits ( Distributor< OrdinalType > const &  distributor,
std::vector< PacketType > &  exports,
OrdinalType  packetSize,
std::vector< PacketType > &  imports 
) [pure virtual]

doReversePostsAndWaits

Execute a reverse plan specified by the distributor object passed in.

Parameters:
distributor In Contains the specifications of the plan we're reverse-executing.
exports In On entry, contains the values we're exporting.
packetSize In On entry, the number of PacketType variables that make up an element.
imports Out On exit, contains the values exported to us. (imports will be resized if necessary, and any existing values will be overwritten.)

Implemented in Tpetra::MpiComm< OrdinalType, PacketType >, and Tpetra::SerialComm< OrdinalType, PacketType >.

template<typename OrdinalType, typename PacketType>
virtual void Tpetra::Comm< OrdinalType, PacketType >::gatherAll ( PacketType *  myVals,
PacketType *  allVals,
OrdinalType const   count 
) const [pure virtual]

Gather All function.

Take list of input values from all images in the communicator and creates an ordered contiguous list of those values on each image.

Parameters:
myVals In On entry, contains the list of values to be sent to all images.
allVals Out On exit, contains the list of values from all images. Must be of size numImages*count.
count In On entry, contains the length of myVals.

Implemented in Tpetra::MpiComm< OrdinalType, PacketType >, and Tpetra::SerialComm< OrdinalType, PacketType >.

template<typename OrdinalType, typename PacketType>
virtual int Tpetra::Comm< OrdinalType, PacketType >::getMyImageID (  )  const [pure virtual]

getMyImageID - returns my rank on this machine

ImageIDs are always in the range [0, numImages), and are returned as an int.

Implemented in Tpetra::MpiComm< OrdinalType, PacketType >, and Tpetra::SerialComm< OrdinalType, PacketType >.

template<typename OrdinalType, typename PacketType>
virtual int Tpetra::Comm< OrdinalType, PacketType >::getNumImages (  )  const [pure virtual]

getNumImages - returns the number of images on this machine

The number of images on this machine is returned as an int, and should always be greater than zero.

Implemented in Tpetra::MpiComm< OrdinalType, PacketType >, and Tpetra::SerialComm< OrdinalType, PacketType >.

template<typename OrdinalType, typename PacketType>
virtual void Tpetra::Comm< OrdinalType, PacketType >::maxAll ( PacketType *  partialMaxs,
PacketType *  globalMaxs,
OrdinalType const   count 
) const [pure virtual]

Global Max function.

Take list of input values from all images in the communicator, computes the max and returns the max to all images.

Parameters:
partialMaxs In On entry, contains the list of values, usually partial maxs computed locally; using these Partial Maxs, the max across all images will be computed.
globalMaxs Out On exit, contains the list of maxs computed across all images.
count In On entry, contains the length of partialMaxs.

Implemented in Tpetra::MpiComm< OrdinalType, PacketType >, and Tpetra::SerialComm< OrdinalType, PacketType >.

template<typename OrdinalType, typename PacketType>
virtual void Tpetra::Comm< OrdinalType, PacketType >::minAll ( PacketType *  partialMins,
PacketType *  globalMins,
OrdinalType const   count 
) const [pure virtual]

Global Min function.

Take list of input values from all images in the communicator, computes the min and returns the min to all images.

Parameters:
partialMins In On entry, contains the list of values, usually partial mins computed locally; using these Partial Mins, the min across all images will be computed.
globalMins Out On exit, contains the list of mins computed across all images.
count In On entry, contains the length of partialMins.

Implemented in Tpetra::MpiComm< OrdinalType, PacketType >, and Tpetra::SerialComm< OrdinalType, PacketType >.

template<typename OrdinalType, typename PacketType>
virtual int Tpetra::Comm< OrdinalType, PacketType >::receive ( PacketType *  myVals,
OrdinalType const   count,
int  sourceImageID 
) const [pure virtual]

Blocking Receive function.

Receive a list of values from another image. Control will not exit this function until data has been received from the source image specified.

Parameters:
myVals Out On exit, contains the list of values received.
count In On entry, contains the length (capacity) of myVals.
sourceImageID In On entry, contains the ImageID of the image to receive the values from. (A sourceImageID of -1 means receive values from any image.)
Returns:
If successful, the ImageID of the sender (>= 0). If not successful, aminteger return code (< 0).

Implemented in Tpetra::MpiComm< OrdinalType, PacketType >, and Tpetra::SerialComm< OrdinalType, PacketType >.

template<typename OrdinalType, typename PacketType>
virtual void Tpetra::Comm< OrdinalType, PacketType >::scanSum ( PacketType *  myVals,
PacketType *  scanSums,
OrdinalType const   count 
) const [pure virtual]

Scan Sum function.

Take list of input values from all images in the communicator, computes the scan sum and returns it to all images such that image i contains the sum of values from image 0 up to and including image i.

Parameters:
myVals In On entry, contains the list of values to be summed across all images.
scanSums Out On exit, contains the list of values summed across images 0 through i.
count In On entry, contains the length of myVals.

Implemented in Tpetra::MpiComm< OrdinalType, PacketType >, and Tpetra::SerialComm< OrdinalType, PacketType >.

template<typename OrdinalType, typename PacketType>
virtual void Tpetra::Comm< OrdinalType, PacketType >::send ( PacketType *  myVals,
OrdinalType const   count,
int  destImageID 
) const [pure virtual]

Blocking Send function.

Sends a list of values to another image. Control will not exit this function until the data have been acknowledged by the receiving image.

Parameters:
myVals In On entry, contains the list of values to be sent.
count In On entry, contains the length of myVals.
destImageID In On entry, contains the ImageID of the image to send the values to.

Implemented in Tpetra::MpiComm< OrdinalType, PacketType >, and Tpetra::SerialComm< OrdinalType, PacketType >.

template<typename OrdinalType, typename PacketType>
virtual void Tpetra::Comm< OrdinalType, PacketType >::sumAll ( PacketType *  partialSums,
PacketType *  globalSums,
OrdinalType const   count 
) const [pure virtual]

Global Sum function.

Take list of input values from all images in the communicator, computes the sum and returns the sum to all images.

Parameters:
partialSums In On entry, contains the list of values, usually partial sums computed locally, to be summed across all images.
globalSums Out On exit, contains the list of values summed across all images.
count In On entry, contains the length of partialSums.

Implemented in Tpetra::MpiComm< OrdinalType, PacketType >, and Tpetra::SerialComm< OrdinalType, PacketType >.

template<typename OrdinalType, typename PacketType>
virtual void Tpetra::Comm< OrdinalType, PacketType >::sumAllAndScatter ( PacketType *  sendVals,
PacketType *  recvVals,
OrdinalType *  recvCounts 
) const [pure virtual]

Scattered Global Sum function.

Take a list of input values from each image, compute the global sums, and distribute the list of sums across all images.

Parameters:
sendVals In On entry, contains the list of values to sum from this image.
recvVals Out On exit, contains the list of sums distributed to this image.
recvCounts In On entry, contains a list of sizes. On exit, recvVals on image i will contain recvCounts[i] entries.

Implemented in Tpetra::MpiComm< OrdinalType, PacketType >, and Tpetra::SerialComm< OrdinalType, PacketType >.


The documentation for this class was generated from the following file:
Generated on Tue Oct 20 12:56:02 2009 for Tpetra by doxygen 1.4.7