Tpetra Matrix/Vector Services Version of the Day
Public Types | 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 Types

typedef Map< LocalOrdinal,
GlobalOrdinal, Node > 
map_type
 The specialization of Map used by this class.

Public Member Functions

Constructor/Destructor Methods
 Export (const Teuchos::RCP< const map_type > &source, const Teuchos::RCP< const map_type > &target)
 Construct a Export object from the source and target Map.
 Export (const Teuchos::RCP< const map_type > &source, const Teuchos::RCP< const map_type > &target, const Teuchos::RCP< Teuchos::ParameterList > &plist)
 Constructor (with list of parameters).
 Export (const Export< LocalOrdinal, GlobalOrdinal, Node > &rhs)
 Copy constructor.
 ~Export ()
 Destructor.
Export Attribute Methods
size_t getNumSameIDs () const
 Number of initial identical IDs.
size_t getNumPermuteIDs () const
 Number of IDs to permute but not to communicate.
ArrayView< const LocalOrdinal > getPermuteFromLIDs () const
 List of local IDs in the source Map that are permuted.
ArrayView< const LocalOrdinal > getPermuteToLIDs () const
 List of local IDs in the target Map that are permuted.
size_t getNumRemoteIDs () const
 Number of entries not on the calling process.
ArrayView< const LocalOrdinal > getRemoteLIDs () const
 List of entries in the target Map to receive from other processes.
size_t getNumExportIDs () const
 Number of entries that must be sent by the calling process to other processes.
ArrayView< const LocalOrdinal > getExportLIDs () const
 List of entries in the source Map that will be sent to other processes.
ArrayView< const int > getExportImageIDs () const
 List of processes to which entries will be sent.
const RCP< const Map
< LocalOrdinal, GlobalOrdinal,
Node > > & 
getSourceMap () const
 The source Map used to construct this Export.
const RCP< const Map
< LocalOrdinal, GlobalOrdinal,
Node > > & 
getTargetMap () const
 The target Map used to construct this Export.
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, both in terms of communication and computation. However, 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 90 of file Tpetra_Export.hpp.


Member Typedef Documentation

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

The specialization of Map used by this class.

Definition at line 94 of file Tpetra_Export.hpp.


Constructor & Destructor Documentation

template<class LocalOrdinal, class GlobalOrdinal = LocalOrdinal, class Node = Kokkos::DefaultNode::DefaultNodeType>
Tpetra::Export< LocalOrdinal, GlobalOrdinal, Node >::Export ( const Teuchos::RCP< const map_type > &  source,
const Teuchos::RCP< const map_type > &  target 
)

Construct a Export object from the source and target Map.

Parameters:
source[in] The source distribution. This may be a multiply owned (overlapping) distribution.
target[in] The target distribution. This must be a uniquely owned (nonoverlapping) distribution.
template<class LocalOrdinal, class GlobalOrdinal = LocalOrdinal, class Node = Kokkos::DefaultNode::DefaultNodeType>
Tpetra::Export< LocalOrdinal, GlobalOrdinal, Node >::Export ( const Teuchos::RCP< const map_type > &  source,
const Teuchos::RCP< const map_type > &  target,
const Teuchos::RCP< Teuchos::ParameterList > &  plist 
)

Constructor (with list of parameters).

Parameters:
source[in] The source distribution. This may be a multiply owned (overlapping) distribution.
target[in] The target distribution. This must be a uniquely owned (nonoverlapping) distribution.
plist[in/out] List of parameters. Currently passed directly to the Distributor that implements communication. If you don't know what this should be, you should use the two-argument constructor, listed above.
template<class LocalOrdinal , class GlobalOrdinal , class Node >
Tpetra::Export< LocalOrdinal, GlobalOrdinal, Node >::Export ( const Export< LocalOrdinal, GlobalOrdinal, Node > &  rhs)

Copy constructor.

Note:
Currently this only makes a shallow copy of the Export's underlying data.

Definition at line 265 of file Tpetra_Export.hpp.

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

Destructor.

Definition at line 270 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]

Number of initial identical IDs.

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

Definition at line 274 of file Tpetra_Export.hpp.

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

Number of IDs to permute but not to communicate.

The number of IDs that are local to the calling process, but not part of the first getNumSameIDs() entries. The Import will permute these entries locally (without distributed-memory communication).

Definition at line 279 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 local IDs in the source Map that are permuted.

Definition at line 285 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 local IDs in the target Map that are permuted.

Definition at line 291 of file Tpetra_Export.hpp.

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

Number of entries not on the calling process.

Definition at line 296 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 to receive from other processes.

Definition at line 302 of file Tpetra_Export.hpp.

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

Number of entries that must be sent by the calling process to other processes.

Definition at line 307 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 processes.

Definition at line 313 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 processes to which entries will be sent.

The entry with local ID getExportLIDs()[i] will be sent to process getExportImageIDs()[i].

Definition at line 319 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 Export.

Definition at line 325 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 Export.

Definition at line 331 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 337 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 343 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 358 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 621 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