Tpetra Matrix/Vector Services Version of the Day
Tpetra::Distributor Class Reference

The Tpetra gather/scatter setup class. More...

#include <Tpetra_Distributor.hpp>

Inheritance diagram for Tpetra::Distributor:
Inheritance graph
[legend]

List of all members.

Public Member Functions

Constructor/Destructor
 Distributor (const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
 Construct the Distributor using the specified communicator.
 Distributor (const Distributor &distributor)
 Copy Constructor.
 ~Distributor ()
 Destructor.
Gather/Scatter Constructors
size_t createFromSends (const Teuchos::ArrayView< const int > &exportNodeIDs)
 Create a Distributor object using list of node IDs to send to.
template<class Ordinal >
void createFromRecvs (const Teuchos::ArrayView< const Ordinal > &remoteIDs, const Teuchos::ArrayView< const int > &remoteNodeIDs, Teuchos::ArrayRCP< Ordinal > &exportIDs, Teuchos::ArrayRCP< int > &exportNodeIDs)
 Create Distributor object using list of node IDs to receive from.
Attribute Accessor Methods
size_t getNumReceives () const
 The number of nodes from which we will receive data, not include this node ("myself").
size_t getNumSends () const
 The number of nodes to which we will send data, not include this node ("myself").
bool hasSelfMessage () const
 Indicates whether values are being sent to/recieved from this node.
size_t getMaxSendLength () const
 Maximum number of values that this node is sending to another single node.
size_t getTotalReceiveLength () const
 Total number of values that this nodes is receiving from other nodes.
Teuchos::ArrayView< const int > getImagesFrom () const
 A list of images sending values to this node. (non-persisting view)
Teuchos::ArrayView< const int > getImagesTo () const
 A list of images to which this node is sending values. (non-persisting view)
Teuchos::ArrayView< const size_t > getLengthsFrom () const
 Number of values we're receiving from each node. (non-persisting view)
Teuchos::ArrayView< const size_t > getLengthsTo () const
 Number of values we're sending to each node. (non-persisting view)
Reverse Communication Methods
const Teuchos::RCP< Distributor > & getReverse () const
 Returns a Distributor with a reverse plan of this Distributor's plan.
Execute Distributor Plan Methods
template<class Packet >
void doPostsAndWaits (const Teuchos::ArrayView< const Packet > &exports, size_t numPackets, const Teuchos::ArrayView< Packet > &imports)
 Execute a plan specified by the distributor object.
template<class Packet >
void doPostsAndWaits (const Teuchos::ArrayView< const Packet > &exports, const Teuchos::ArrayView< size_t > &numExportPacketsPerLID, const Teuchos::ArrayView< Packet > &imports, const Teuchos::ArrayView< size_t > &numImportPacketsPerLID)
 Execute a plan specified by the distributor object.
template<class Packet >
void doPosts (const Teuchos::ArrayView< const Packet > &exports, size_t numPackets, const Teuchos::ArrayRCP< Packet > &imports)
 Post the data for a distributor plan, but do not execute the waits yet.
template<class Packet >
void doPosts (const Teuchos::ArrayView< const Packet > &exports, const Teuchos::ArrayView< size_t > &numExportPacketsPerLID, const Teuchos::ArrayRCP< Packet > &imports, const Teuchos::ArrayView< size_t > &numImportPacketsPerLID)
 Post the data for a distributor plan, but do not execute the waits yet.
void doWaits ()
 Wait on any outstanding posts to complete.
template<class Packet >
void doReversePostsAndWaits (const Teuchos::ArrayView< const Packet > &exports, size_t numPackets, const Teuchos::ArrayView< Packet > &imports)
 Execute a reverse plan specified by the distributor object.
template<class Packet >
void doReversePostsAndWaits (const Teuchos::ArrayView< const Packet > &exports, const Teuchos::ArrayView< size_t > &numExportPacketsPerLID, const Teuchos::ArrayView< Packet > &imports, const Teuchos::ArrayView< size_t > &numImportPacketsPerLID)
 Execute a reverse plan specified by the distributor object.
template<class Packet >
void doReversePosts (const Teuchos::ArrayView< const Packet > &exports, size_t numPackets, const Teuchos::ArrayRCP< Packet > &imports)
 Post the data for a reverse plan, but do not execute the waits yet.
template<class Packet >
void doReversePosts (const Teuchos::ArrayView< const Packet > &exports, const Teuchos::ArrayView< size_t > &numExportPacketsPerLID, const Teuchos::ArrayRCP< Packet > &imports, const Teuchos::ArrayView< size_t > &numImportPacketsPerLID)
 Post the data for a reverse plan, but do not execute the waits yet.
void doReverseWaits ()
 Wait on any outstanding reverse waits to complete.
Overridden from Teuchos::Describable
std::string description () const
 Return a simple one-line description of this object.
void describe (Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
 Print the object with some verbosity level to an FancyOStream object.

Detailed Description

The Tpetra gather/scatter setup class.

The Distributor class is an interface that encapsulates the general information and services needed for other Tpetra classes to perform gather/scatter operations on a parallel computer.

Definition at line 48 of file Tpetra_Distributor.hpp.


Constructor & Destructor Documentation

Tpetra::Distributor::Distributor ( const Teuchos::RCP< const Teuchos::Comm< int > > &  comm) [explicit]

Construct the Distributor using the specified communicator.

Definition at line 33 of file Tpetra_Distributor.cpp.

Tpetra::Distributor::Distributor ( const Distributor distributor)

Copy Constructor.

Definition at line 43 of file Tpetra_Distributor.cpp.

Tpetra::Distributor::~Distributor ( )

Destructor.

Definition at line 54 of file Tpetra_Distributor.cpp.


Member Function Documentation

size_t Tpetra::Distributor::createFromSends ( const Teuchos::ArrayView< const int > &  exportNodeIDs)

Create a Distributor object using list of node IDs to send to.

Take a list of node IDs and construct a plan for efficiently scattering to those nodes. Return the number of IDs being sent to me.

Parameters:
exportNodeIDs[in] List of nodes that will get the exported data. A node ID greater than or equal to the number of nodes will result in a std::runtime_error on all nodes. Node IDs less than zero are ignored; their placement corresponds to null sends in any future exports. That is, if exportNodeIDs[0] == -1, then the corresponding position in the export array is ignored during a call to doPosts() or doPostsAndWaits() is skipped. For this reason, a negative entry is sufficient to break contiguity.
Returns:
Number of imports this node will be receiving.

Definition at line 299 of file Tpetra_Distributor.cpp.

template<class Ordinal >
void Tpetra::Distributor::createFromRecvs ( const Teuchos::ArrayView< const Ordinal > &  remoteIDs,
const Teuchos::ArrayView< const int > &  remoteNodeIDs,
Teuchos::ArrayRCP< Ordinal > &  exportIDs,
Teuchos::ArrayRCP< int > &  exportNodeIDs 
)

Create Distributor object using list of node IDs to receive from.

Take a list of node IDs and construct a plan for efficiently scattering to those nodes. Return the number and list of IDs being sent by me.

Parameters:
remoteIDs[in] List of remote IDs wanted.
remoteNodeIDs[in] List of nodes that will send the corresponding remote IDs. Node IDs less than zero are ignored; their placement corresponds to null sends in any future exports. A node ID greater than or equal to the number of nodes will result in a std::runtime_error on all nodes.
exportIDs[out] List of IDs that need to be sent from this node.
exportNodeIDs[out] List of nodes that will get the exported IDs.
Note:
exportGIDs and exportNodeIDs are allocated by the Distributor, but they are reference counted and will be automatically deallocated.

Definition at line 788 of file Tpetra_Distributor.hpp.

size_t Tpetra::Distributor::getNumReceives ( ) const

The number of nodes from which we will receive data, not include this node ("myself").

Definition at line 64 of file Tpetra_Distributor.cpp.

size_t Tpetra::Distributor::getNumSends ( ) const

The number of nodes to which we will send data, not include this node ("myself").

Definition at line 70 of file Tpetra_Distributor.cpp.

bool Tpetra::Distributor::hasSelfMessage ( ) const

Indicates whether values are being sent to/recieved from this node.

If we are sending any elements to ourself, returns true. If we aren't, returns false.

Definition at line 67 of file Tpetra_Distributor.cpp.

size_t Tpetra::Distributor::getMaxSendLength ( ) const

Maximum number of values that this node is sending to another single node.

Definition at line 73 of file Tpetra_Distributor.cpp.

size_t Tpetra::Distributor::getTotalReceiveLength ( ) const

Total number of values that this nodes is receiving from other nodes.

Definition at line 61 of file Tpetra_Distributor.cpp.

Teuchos::ArrayView< const int > Tpetra::Distributor::getImagesFrom ( ) const

A list of images sending values to this node. (non-persisting view)

Definition at line 76 of file Tpetra_Distributor.cpp.

Teuchos::ArrayView< const int > Tpetra::Distributor::getImagesTo ( ) const

A list of images to which this node is sending values. (non-persisting view)

Definition at line 82 of file Tpetra_Distributor.cpp.

Teuchos::ArrayView< const size_t > Tpetra::Distributor::getLengthsFrom ( ) const

Number of values we're receiving from each node. (non-persisting view)

We will receive getLengthsFrom[i] values from node getImagesFrom[i].

Definition at line 79 of file Tpetra_Distributor.cpp.

Teuchos::ArrayView< const size_t > Tpetra::Distributor::getLengthsTo ( ) const

Number of values we're sending to each node. (non-persisting view)

We will send getLengthsTo[i] values to image getImagesTo[i].

Definition at line 85 of file Tpetra_Distributor.cpp.

const Teuchos::RCP< Distributor > & Tpetra::Distributor::getReverse ( ) const

Returns a Distributor with a reverse plan of this Distributor's plan.

This method creates the reverse Distributor the first time the function is called.

Definition at line 89 of file Tpetra_Distributor.cpp.

template<class Packet >
void Tpetra::Distributor::doPostsAndWaits ( const Teuchos::ArrayView< const Packet > &  exports,
size_t  numPackets,
const Teuchos::ArrayView< Packet > &  imports 
)

Execute a plan specified by the distributor object.

Parameters:
exports[in] Contains the values we're exporting.
numPackets[in] Specifies the number of values per export/import.
imports[out] On entry, buffer must be large enough to accomodate the data exported to us. On exit, contains the values exported to us.

Definition at line 383 of file Tpetra_Distributor.hpp.

template<class Packet >
void Tpetra::Distributor::doPostsAndWaits ( const Teuchos::ArrayView< const Packet > &  exports,
const Teuchos::ArrayView< size_t > &  numExportPacketsPerLID,
const Teuchos::ArrayView< Packet > &  imports,
const Teuchos::ArrayView< size_t > &  numImportPacketsPerLID 
)

Execute a plan specified by the distributor object.

Parameters:
exports[in] Contains the values we're exporting.
numPackets[in] Specifies the number of values per export/import.
imports[out] On entry, buffer must be large enough to accomodate the data exported to us. On exit, contains the values exported to us.

Definition at line 398 of file Tpetra_Distributor.hpp.

template<class Packet >
void Tpetra::Distributor::doPosts ( const Teuchos::ArrayView< const Packet > &  exports,
size_t  numPackets,
const Teuchos::ArrayRCP< Packet > &  imports 
)

Post the data for a distributor plan, but do not execute the waits yet.

Parameters:
exports[in] Contains the values to be sent by this node.
numPackets[in] Specifies the number of scalars per export/import.
imports[out] Buffer must be large enough to accomodate the data exported to us. The buffer is not guaranteed to be filled until doWaits() is executed.

Definition at line 415 of file Tpetra_Distributor.hpp.

template<class Packet >
void Tpetra::Distributor::doPosts ( const Teuchos::ArrayView< const Packet > &  exports,
const Teuchos::ArrayView< size_t > &  numExportPacketsPerLID,
const Teuchos::ArrayRCP< Packet > &  imports,
const Teuchos::ArrayView< size_t > &  numImportPacketsPerLID 
)

Post the data for a distributor plan, but do not execute the waits yet.

Parameters:
exports[in] Contains the values to be sent by this node.
numPackets[in] Specifies the number of scalars per export/import.
imports[out] Buffer must be large enough to accomodate the data exported to us. The buffer is not guaranteed to be filled until doWaits() is executed.

Definition at line 536 of file Tpetra_Distributor.hpp.

void Tpetra::Distributor::doWaits ( )

Wait on any outstanding posts to complete.

Definition at line 137 of file Tpetra_Distributor.cpp.

template<class Packet >
void Tpetra::Distributor::doReversePostsAndWaits ( const Teuchos::ArrayView< const Packet > &  exports,
size_t  numPackets,
const Teuchos::ArrayView< Packet > &  imports 
)

Execute a reverse plan specified by the distributor object.

Parameters:
exports[in] Contains the values to be sent by this node.
numPackets[in] Specifies the number of scalars per export/import.
imports[out] On entry, buffer must be large enough to accomodate the data exported to us. On exit, contains the values exported to us.

Definition at line 693 of file Tpetra_Distributor.hpp.

template<class Packet >
void Tpetra::Distributor::doReversePostsAndWaits ( const Teuchos::ArrayView< const Packet > &  exports,
const Teuchos::ArrayView< size_t > &  numExportPacketsPerLID,
const Teuchos::ArrayView< Packet > &  imports,
const Teuchos::ArrayView< size_t > &  numImportPacketsPerLID 
)

Execute a reverse plan specified by the distributor object.

Parameters:
exports[in] Contains the values to be sent by this node.
numPackets[in] Specifies the number of scalars per export/import.
imports[out] On entry, buffer must be large enough to accomodate the data exported to us. On exit, contains the values exported to us.

Definition at line 706 of file Tpetra_Distributor.hpp.

template<class Packet >
void Tpetra::Distributor::doReversePosts ( const Teuchos::ArrayView< const Packet > &  exports,
size_t  numPackets,
const Teuchos::ArrayRCP< Packet > &  imports 
)

Post the data for a reverse plan, but do not execute the waits yet.

Parameters:
exports[in] Contains the values we're exporting.
numPackets[in] Specifies the number of scalars per export/import.
imports[out] Buffer must be large enough to accomodate the data exported to us. The buffer is not guaranteed to be filled until doWaits() is executed.

Definition at line 721 of file Tpetra_Distributor.hpp.

template<class Packet >
void Tpetra::Distributor::doReversePosts ( const Teuchos::ArrayView< const Packet > &  exports,
const Teuchos::ArrayView< size_t > &  numExportPacketsPerLID,
const Teuchos::ArrayRCP< Packet > &  imports,
const Teuchos::ArrayView< size_t > &  numImportPacketsPerLID 
)

Post the data for a reverse plan, but do not execute the waits yet.

Parameters:
exports[in] Contains the values we're exporting.
numPackets[in] Specifies the number of scalars per export/import.
imports[out] Buffer must be large enough to accomodate the data exported to us. The buffer is not guaranteed to be filled until doWaits() is executed.

Definition at line 735 of file Tpetra_Distributor.hpp.

void Tpetra::Distributor::doReverseWaits ( )

Wait on any outstanding reverse waits to complete.

Definition at line 154 of file Tpetra_Distributor.cpp.

std::string Tpetra::Distributor::description ( ) const [virtual]

Return a simple one-line description of this object.

Reimplemented from Teuchos::Describable.

Definition at line 162 of file Tpetra_Distributor.cpp.

void Tpetra::Distributor::describe ( Teuchos::FancyOStream out,
const Teuchos::EVerbosityLevel  verbLevel = Teuchos::Describable::verbLevel_default 
) const [virtual]

Print the object with some verbosity level to an FancyOStream object.

Reimplemented from Teuchos::Describable.

Definition at line 169 of file Tpetra_Distributor.cpp.


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