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
 Accessor for whether or not this is a global object.
const Teuchos::RCP< const Map
< LocalOrdinal, GlobalOrdinal,
Node > > & 
getMap () const
 Access function for the Tpetra::Map this DistObject was constructed with.
I/O methods
void print (std::ostream &os) const
 Print method.

Protected Types

enum  ReverseOption
 Enum indicating whether the transer 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
 Allows the source and target (this) objects to be compared 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.

The 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 65 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]

Enum indicating whether the transer should be performed in forward or reverse mode.

Definition at line 127 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 239 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 244 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 249 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 253 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 268 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 283 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 299 of file Tpetra_DistObject.hpp.

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

Accessor for whether or not this is a global object.

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

Access function for the Tpetra::Map this DistObject was constructed with.

Definition at line 111 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 393 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 319 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]

Allows the source and target (this) objects to be compared for compatibility.

Return true if they are compatible, return false if they aren't.

Implemented in Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node, LocalMatOps >, Tpetra::CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps >, and Tpetra::MultiVector< 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 >::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:
sourceIn On entry, the DistObject that we are importing from.
numSameIDsIn 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.)
numPermuteIDsIn On entry, the number of elements that are locally permuted between source and dest objects.
permuteToLIDsIn On entry, contains a list of the elements that are permuted. (Listed by their LID in the destination DistObject.)
permuteFromLIDsIn 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 >, and Tpetra::MultiVector< 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:
sourceIn On entry, the DistObject that we are importing from.
exportLIDsIn On entry, a list of the entries we will be sending to other images. (Listed by their LID in the source DistObject.)
exportsOut On exit, buffer for data we will be sending out.
numPacketsPerLIDOut On exit, numPacketsPerLID[i] contains the number of packets to be exported for exportLIDs[i].
constantNumPacketsOut 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.
distorIn On entry, contains the Distributor object we are using.

Implemented in Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node, LocalMatOps >, Tpetra::CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps >, and Tpetra::MultiVector< 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:
importLIDsIn On entry, a list of the entries we received from other images. (Listed by their LID in the target DistObject.)
importsIn Buffer containing data we received.
numPacketsPerLIDIn numPacketsPerLID[i] contains the number of packets imported for importLIDs[i].
constantNumPacketsIn If nonzero, then numPacketsPerLID is constant (same value in all entries) and constantNumPackets is that value.
distorIn The Distributor object we are using.
CMIn 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 >, and Tpetra::MultiVector< 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