Tpetra Matrix/Vector Services Version of the Day
Protected Types | Protected Member Functions
Tpetra::DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node > Class Template Reference

A base class for distributed objects that support import and export operations. More...

#include <Tpetra_DistObject.hpp>

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

List of all members.

Public Member Functions

Constructor/Destructor Methods
 DistObject (const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map)
 constructor
 DistObject (const DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node > &source)
 copy constructor
virtual ~DistObject ()
 destructor
Import/Export Methods
void doImport (const DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
 Import.
void doExport (const DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
 Export.
void doImport (const DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
 Import (using an Exporter)
void doExport (const DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
 Export (using an Importer)
Attribute Accessor Methods
bool isDistributed () const
 True if this is a globally distributed object, else false.
const Teuchos::RCP< const Map
< LocalOrdinal, GlobalOrdinal,
Node > > & 
getMap () const
 The Map with which this DistObject was constructed.
I/O methods
void print (std::ostream &os) const
 Print method.

Protected Types

enum  ReverseOption
 Whether the data transfer should be performed in forward or reverse mode. More...

Protected Member Functions

virtual void doTransfer (const DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node > &source, CombineMode CM, size_t numSameIDs, const Teuchos::ArrayView< const LocalOrdinal > &permuteToLIDs, const Teuchos::ArrayView< const LocalOrdinal > &permuteFromLIDs, const Teuchos::ArrayView< const LocalOrdinal > &remoteLIDs, const Teuchos::ArrayView< const LocalOrdinal > &exportLIDs, Distributor &distor, ReverseOption revOp)
 Perform transfer (redistribution) of data across memory images.
virtual bool checkSizes (const DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node > &source)=0
 Compare the source and target (this) objects for compatibility.
virtual void copyAndPermute (const DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node > &source, size_t numSameIDs, const Teuchos::ArrayView< const LocalOrdinal > &permuteToLIDs, const Teuchos::ArrayView< const LocalOrdinal > &permuteFromLIDs)=0
 Perform copies and permutations that are local to this image.
virtual void packAndPrepare (const DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node > &source, const Teuchos::ArrayView< const LocalOrdinal > &exportLIDs, Teuchos::Array< Packet > &exports, const Teuchos::ArrayView< size_t > &numPacketsPerLID, size_t &constantNumPackets, Distributor &distor)=0
 Perform any packing or preparation required for communication.
virtual void unpackAndCombine (const Teuchos::ArrayView< const LocalOrdinal > &importLIDs, const Teuchos::ArrayView< const Packet > &imports, const Teuchos::ArrayView< size_t > &numPacketsPerLID, size_t constantNumPackets, Distributor &distor, CombineMode CM)=0
 Perform any unpacking and combining after communication.

Detailed Description

template<class Packet, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = Kokkos::DefaultNode::DefaultNodeType>
class Tpetra::DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node >

A base class for distributed objects that support import and export operations.

DistObject is a base class for all Tpetra distributed global objects. It provides the basic mechanisms and interface specifications for importing and exporting operations using Tpetra::Import and Tpetra::Export objects.

Distributed Global vs. Replicated Local.

Definition at line 81 of file Tpetra_DistObject.hpp.


Member Enumeration Documentation

template<class Packet, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = Kokkos::DefaultNode::DefaultNodeType>
enum Tpetra::DistObject::ReverseOption [protected]

Whether the data transfer should be performed in forward or reverse mode.

Definition at line 151 of file Tpetra_DistObject.hpp.


Constructor & Destructor Documentation

template<class Packet , class LocalOrdinal, class GlobalOrdinal, class Node>
Tpetra::DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node >::DistObject ( const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &  map) [explicit]

constructor

Definition at line 266 of file Tpetra_DistObject.hpp.

template<class Packet, class LocalOrdinal, class GlobalOrdinal, class Node>
Tpetra::DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node >::DistObject ( const DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node > &  source)

copy constructor

Definition at line 271 of file Tpetra_DistObject.hpp.

template<class Packet , class LocalOrdinal , class GlobalOrdinal , class Node >
Tpetra::DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node >::~DistObject ( ) [virtual]

destructor

Definition at line 276 of file Tpetra_DistObject.hpp.


Member Function Documentation

template<class Packet, class LocalOrdinal, class GlobalOrdinal, class Node>
void Tpetra::DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node >::doImport ( const DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node > &  source,
const Import< LocalOrdinal, GlobalOrdinal, Node > &  importer,
CombineMode  CM 
)

Import.

Definition at line 282 of file Tpetra_DistObject.hpp.

template<class Packet, class LocalOrdinal, class GlobalOrdinal, class Node>
void Tpetra::DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node >::doExport ( const DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node > &  dest,
const Export< LocalOrdinal, GlobalOrdinal, Node > &  exporter,
CombineMode  CM 
)

Export.

Definition at line 300 of file Tpetra_DistObject.hpp.

template<class Packet, class LocalOrdinal, class GlobalOrdinal, class Node>
void Tpetra::DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node >::doImport ( const DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node > &  source,
const Export< LocalOrdinal, GlobalOrdinal, Node > &  exporter,
CombineMode  CM 
)

Import (using an Exporter)

Definition at line 318 of file Tpetra_DistObject.hpp.

template<class Packet, class LocalOrdinal, class GlobalOrdinal, class Node>
void Tpetra::DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node >::doExport ( const DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node > &  dest,
const Import< LocalOrdinal, GlobalOrdinal, Node > &  importer,
CombineMode  CM 
)

Export (using an Importer)

Definition at line 336 of file Tpetra_DistObject.hpp.

template<class Packet , class LocalOrdinal , class GlobalOrdinal , class Node >
bool Tpetra::DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node >::isDistributed ( ) const [inline]

True if this is a globally distributed object, else false.

For a definition of "globally distributed" (and its opposite, "locally replicated"), see the documentation of Map.

Definition at line 352 of file Tpetra_DistObject.hpp.

template<class Packet, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = Kokkos::DefaultNode::DefaultNodeType>
const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& Tpetra::DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node >::getMap ( ) const [inline]

The Map with which this DistObject was constructed.

Definition at line 134 of file Tpetra_DistObject.hpp.

template<class Packet , class LocalOrdinal , class GlobalOrdinal , class Node >
void Tpetra::DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node >::print ( std::ostream &  os) const

Print method.

Definition at line 431 of file Tpetra_DistObject.hpp.

template<class Packet, class LocalOrdinal, class GlobalOrdinal, class Node>
void Tpetra::DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node >::doTransfer ( const DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node > &  source,
CombineMode  CM,
size_t  numSameIDs,
const Teuchos::ArrayView< const LocalOrdinal > &  permuteToLIDs,
const Teuchos::ArrayView< const LocalOrdinal > &  permuteFromLIDs,
const Teuchos::ArrayView< const LocalOrdinal > &  remoteLIDs,
const Teuchos::ArrayView< const LocalOrdinal > &  exportLIDs,
Distributor distor,
ReverseOption  revOp 
) [protected, virtual]

Perform transfer (redistribution) of data across memory images.

Definition at line 357 of file Tpetra_DistObject.hpp.

template<class Packet, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = Kokkos::DefaultNode::DefaultNodeType>
virtual bool Tpetra::DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node >::checkSizes ( const DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node > &  source) [protected, pure virtual]
template<class Packet, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = Kokkos::DefaultNode::DefaultNodeType>
virtual void Tpetra::DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node >::copyAndPermute ( const DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node > &  source,
size_t  numSameIDs,
const Teuchos::ArrayView< const LocalOrdinal > &  permuteToLIDs,
const Teuchos::ArrayView< const LocalOrdinal > &  permuteFromLIDs 
) [protected, pure virtual]

Perform copies and permutations that are local to this image.

Parameters:
source[in] On entry, the DistObject that we are importing from.
numSameIDs[in] On entry, the number of elements that are the same on the source and dest objects. (i.e. The element is owned by the same image in both source and dest, and no permutation occurs.)
numPermuteIDs[in] On entry, the number of elements that are locally permuted between source and dest objects.
permuteToLIDs[in] On entry, contains a list of the elements that are permuted. (Listed by their LID in the destination DistObject.)
permuteFromLIDs[in] On entry, contains a list of the elements that are permuted. (Listed by their LID in the source DistObject.)

Implemented in Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node, LocalMatOps >, Tpetra::CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps >, Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node >, Tpetra::VbrMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps >, Tpetra::CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps >, and Tpetra::CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node >.

template<class Packet, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = Kokkos::DefaultNode::DefaultNodeType>
virtual void Tpetra::DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node >::packAndPrepare ( const DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node > &  source,
const Teuchos::ArrayView< const LocalOrdinal > &  exportLIDs,
Teuchos::Array< Packet > &  exports,
const Teuchos::ArrayView< size_t > &  numPacketsPerLID,
size_t &  constantNumPackets,
Distributor distor 
) [protected, pure virtual]

Perform any packing or preparation required for communication.

Parameters:
source[in] On entry, the DistObject that we are importing from.
exportLIDs[in] On entry, a list of the entries we will be sending to other images. (Listed by their LID in the source DistObject.)
exports[out] On exit, buffer for data we will be sending out.
numPacketsPerLID[out] On exit, numPacketsPerLID[i] contains the number of packets to be exported for exportLIDs[i].
constantNumPackets[out] On exit, 0 if numPacketsPerLID has variable contents (different size for each LID). If nonzero, then it is expected that num-packets-per-LID is constant, and constantNumPackets holds that value.
distor[in] On entry, contains the Distributor object we are using.

Implemented in Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node, LocalMatOps >, Tpetra::CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps >, Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node >, Tpetra::VbrMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps >, Tpetra::CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps >, and Tpetra::CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node >.

template<class Packet, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = Kokkos::DefaultNode::DefaultNodeType>
virtual void Tpetra::DistObject< Packet, LocalOrdinal, GlobalOrdinal, Node >::unpackAndCombine ( const Teuchos::ArrayView< const LocalOrdinal > &  importLIDs,
const Teuchos::ArrayView< const Packet > &  imports,
const Teuchos::ArrayView< size_t > &  numPacketsPerLID,
size_t  constantNumPackets,
Distributor distor,
CombineMode  CM 
) [protected, pure virtual]

Perform any unpacking and combining after communication.

Parameters:
importLIDs[in] On entry, a list of the entries we received from other images. (Listed by their LID in the target DistObject.)
imports[in] Buffer containing data we received.
numPacketsPerLID[in] numPacketsPerLID[i] contains the number of packets imported for importLIDs[i].
constantNumPackets[in] If nonzero, then numPacketsPerLID is constant (same value in all entries) and constantNumPackets is that value.
distor[in] The Distributor object we are using.
CM[in] The Tpetra::CombineMode to use when combining the imported entries with existing entries.

Implemented in Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node, LocalMatOps >, Tpetra::CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps >, Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node >, Tpetra::VbrMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps >, Tpetra::CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps >, and Tpetra::CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node >.


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