Tpetra Matrix/Vector Services Version of the Day
Related Functions
Tpetra::Export< LocalOrdinal, GlobalOrdinal, Node > Class Template Reference

Communication plan for data redistribution from a (possibly) multiply-owned to a uniquely-owned distribution. More...

#include <Tpetra_Export.hpp>

Inheritance diagram for Tpetra::Export< LocalOrdinal, GlobalOrdinal, Node >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

Constructor/Destructor Methods
 Export (const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &source, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &target)
 Construct a Export object from the source and target Map.
 Export (const Export< LocalOrdinal, GlobalOrdinal, Node > &rhs)
 Copy constructor.
 ~Export ()
 Destructor.
Export Attribute Methods
size_t getNumSameIDs () const
 The number of entries that are identical between the source and target maps, up to the first different ID.
size_t getNumPermuteIDs () const
 The number of entries that are local to the calling image, but not part of the first getNumSameIDs() entries.
ArrayView< const LocalOrdinal > getPermuteFromLIDs () const
 List of entries in the source Map that are permuted. (non-persisting view)
ArrayView< const LocalOrdinal > getPermuteToLIDs () const
 List of entries in the target Map that are permuted. (non-persisting view)
size_t getNumRemoteIDs () const
 The number of entries that are not on the calling image.
ArrayView< const LocalOrdinal > getRemoteLIDs () const
 List of entries in the target Map that are coming from other images. (non-persisting view)
size_t getNumExportIDs () const
 The number of entries that must be sent by the calling image to other images.
ArrayView< const LocalOrdinal > getExportLIDs () const
 List of entries in the source Map that will be sent to other images. (non-persisting view)
ArrayView< const int > getExportImageIDs () const
 List of images to which entries will be sent, getExportLIDs() [i] will be sent to image getExportImageIDs() [i]. (non-persisting view)
const RCP< const Map
< LocalOrdinal, GlobalOrdinal,
Node > > & 
getSourceMap () const
 The source Map used to construct this exporter.
const RCP< const Map
< LocalOrdinal, GlobalOrdinal,
Node > > & 
getTargetMap () const
 The target Map used to construct this exporter.
DistributorgetDistributor () const
 The Distributor that this Export object uses to move data.
Export< LocalOrdinal,
GlobalOrdinal, Node > & 
operator= (const Export< LocalOrdinal, GlobalOrdinal, Node > &rhs)
 Assignment operator.
I/O Methods
virtual void print (std::ostream &os) const
 Print the Export's data to the given output stream.

Related Functions

(Note that these are not member functions.)

template<class LO , class GO , class Node >
RCP< const Export< LO, GO, Node > > createExport (const RCP< const Map< LO, GO, Node > > &src, const RCP< const Map< LO, GO, Node > > &tgt)
 Non-member constructor for Export objects.

Detailed Description

template<class LocalOrdinal, class GlobalOrdinal = LocalOrdinal, class Node = Kokkos::DefaultNode::DefaultNodeType>
class Tpetra::Export< LocalOrdinal, GlobalOrdinal, Node >

Communication plan for data redistribution from a (possibly) multiply-owned to a uniquely-owned distribution.

Tpetra users should use this class to construct a communication plan between two data distributions (i.e., two Map objects). The plan can be called repeatedly by computational classes to perform communication according to the same pattern. Constructing the plan may be expensive, but it can be reused inexpensively.

Tpetra has two classes for data redistribution: Import and Export. Import is for redistributing data from a uniquely-owned distribution to a possibly multiply-owned distribution. Export is for redistributing data from a possibly multiply-owned distribution to a uniquely-owned distribution.

One use case of Export is finite element assembly. For example, one way to compute a distributed forcing term vector is to use an overlapping distribution for the basis functions' domains. An Export with the SUM combine mode combines each process' contribution to the integration into a single nonoverlapping distribution.

Epetra separated Import and Export for performance reasons. The implementation is different, depending on which direction is the uniquely-owned Map. Tpetra retains this convention.

This class is templated on the same template arguments as Map: the local ordinal type (LocalOrdinal), the global ordinal type (GlobalOrdinal), and the Kokkos Node type (Node).

Definition at line 88 of file Tpetra_Export.hpp.


Constructor & Destructor Documentation

template<class LocalOrdinal , class GlobalOrdinal , class Node >
Tpetra::Export< LocalOrdinal, GlobalOrdinal, Node >::Export ( const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &  source,
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &  target 
)

Construct a Export object from the source and target Map.

Parameters:
source[in] The source distribution. This may be an multiply owned (overlapping) distribution.
target[in] The target distribution. This must be a uniquely owned (nonoverlapping) distribution.

Definition at line 197 of file Tpetra_Export.hpp.

template<class LocalOrdinal , class GlobalOrdinal , class Node >
Tpetra::Export< LocalOrdinal, GlobalOrdinal, Node >::Export ( const Export< LocalOrdinal, GlobalOrdinal, Node > &  rhs)

Copy constructor.

Definition at line 208 of file Tpetra_Export.hpp.

template<class LocalOrdinal , class GlobalOrdinal , class Node >
Tpetra::Export< LocalOrdinal, GlobalOrdinal, Node >::~Export ( )

Destructor.

Definition at line 213 of file Tpetra_Export.hpp.


Member Function Documentation

template<class LocalOrdinal , class GlobalOrdinal , class Node >
size_t Tpetra::Export< LocalOrdinal, GlobalOrdinal, Node >::getNumSameIDs ( ) const [inline]

The number of entries that are identical between the source and target maps, up to the first different ID.

Definition at line 217 of file Tpetra_Export.hpp.

template<class LocalOrdinal , class GlobalOrdinal , class Node >
size_t Tpetra::Export< LocalOrdinal, GlobalOrdinal, Node >::getNumPermuteIDs ( ) const [inline]

The number of entries that are local to the calling image, but not part of the first getNumSameIDs() entries.

Definition at line 222 of file Tpetra_Export.hpp.

template<class LocalOrdinal , class GlobalOrdinal , class Node >
ArrayView< const LocalOrdinal > Tpetra::Export< LocalOrdinal, GlobalOrdinal, Node >::getPermuteFromLIDs ( ) const [inline]

List of entries in the source Map that are permuted. (non-persisting view)

Definition at line 228 of file Tpetra_Export.hpp.

template<class LocalOrdinal , class GlobalOrdinal , class Node >
ArrayView< const LocalOrdinal > Tpetra::Export< LocalOrdinal, GlobalOrdinal, Node >::getPermuteToLIDs ( ) const [inline]

List of entries in the target Map that are permuted. (non-persisting view)

Definition at line 234 of file Tpetra_Export.hpp.

template<class LocalOrdinal , class GlobalOrdinal , class Node >
size_t Tpetra::Export< LocalOrdinal, GlobalOrdinal, Node >::getNumRemoteIDs ( ) const [inline]

The number of entries that are not on the calling image.

Definition at line 239 of file Tpetra_Export.hpp.

template<class LocalOrdinal , class GlobalOrdinal , class Node >
ArrayView< const LocalOrdinal > Tpetra::Export< LocalOrdinal, GlobalOrdinal, Node >::getRemoteLIDs ( ) const [inline]

List of entries in the target Map that are coming from other images. (non-persisting view)

Definition at line 245 of file Tpetra_Export.hpp.

template<class LocalOrdinal , class GlobalOrdinal , class Node >
size_t Tpetra::Export< LocalOrdinal, GlobalOrdinal, Node >::getNumExportIDs ( ) const [inline]

The number of entries that must be sent by the calling image to other images.

Definition at line 250 of file Tpetra_Export.hpp.

template<class LocalOrdinal , class GlobalOrdinal , class Node >
ArrayView< const LocalOrdinal > Tpetra::Export< LocalOrdinal, GlobalOrdinal, Node >::getExportLIDs ( ) const [inline]

List of entries in the source Map that will be sent to other images. (non-persisting view)

Definition at line 256 of file Tpetra_Export.hpp.

template<class LocalOrdinal , class GlobalOrdinal , class Node >
ArrayView< const int > Tpetra::Export< LocalOrdinal, GlobalOrdinal, Node >::getExportImageIDs ( ) const [inline]

List of images to which entries will be sent, getExportLIDs() [i] will be sent to image getExportImageIDs() [i]. (non-persisting view)

Definition at line 262 of file Tpetra_Export.hpp.

template<class LocalOrdinal , class GlobalOrdinal , class Node >
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > & Tpetra::Export< LocalOrdinal, GlobalOrdinal, Node >::getSourceMap ( ) const [inline]

The source Map used to construct this exporter.

Definition at line 268 of file Tpetra_Export.hpp.

template<class LocalOrdinal , class GlobalOrdinal , class Node >
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > & Tpetra::Export< LocalOrdinal, GlobalOrdinal, Node >::getTargetMap ( ) const [inline]

The target Map used to construct this exporter.

Definition at line 274 of file Tpetra_Export.hpp.

template<class LocalOrdinal , class GlobalOrdinal , class Node >
Distributor & Tpetra::Export< LocalOrdinal, GlobalOrdinal, Node >::getDistributor ( ) const [inline]

The Distributor that this Export object uses to move data.

Definition at line 280 of file Tpetra_Export.hpp.

template<class LocalOrdinal , class GlobalOrdinal , class Node >
Export< LocalOrdinal, GlobalOrdinal, Node > & Tpetra::Export< LocalOrdinal, GlobalOrdinal, Node >::operator= ( const Export< LocalOrdinal, GlobalOrdinal, Node > &  rhs)

Assignment operator.

Definition at line 286 of file Tpetra_Export.hpp.

template<class LocalOrdinal , class GlobalOrdinal , class Node >
void Tpetra::Export< LocalOrdinal, GlobalOrdinal, Node >::print ( std::ostream &  os) const [virtual]

Print the Export's data to the given output stream.

This method assumes that the given output stream can be written on all process(es) in the Export's communicator. The resulting output is useful mainly for debugging.

Note:
This method tries its best (by using barriers at the end of each iteration of a for loop over all communicator ranks) to ensure ordered deterministic output. However, the assumption that all processes can write to the stream means that there are no ordering guarantees other than what the operating and run-time system provide. (MPI synchronization may be separate from output stream synchronization, so the barriers only improve the chances that output can complete before the next process starts writing.)

Definition at line 301 of file Tpetra_Export.hpp.


Friends And Related Function Documentation

template<class LO , class GO , class Node >
RCP< const Export< LO, GO, Node > > createExport ( const RCP< const Map< LO, GO, Node > > &  src,
const RCP< const Map< LO, GO, Node > > &  tgt 
) [related]

Non-member constructor for Export objects.

Creates a Export object from the given source and target maps.

Precondition:
src != null
tgt != null
Returns:
Returns the Export object. If src == tgt, returns null. (Debug mode: throws std::runtime_error if one of src or tgt is null.)

Definition at line 533 of file Tpetra_Export.hpp.


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