Tpetra parallel linear algebra Version of the Day
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Tpetra::Details::Transfer< LO, GO, NT > Class Template Reference

Common base class of Import and Export. More...

#include <Tpetra_Details_Transfer_decl.hpp>

Inheritance diagram for Tpetra::Details::Transfer< LO, GO, NT >:
Inheritance graph
[legend]

Public Types

using map_type = ::Tpetra::Map< LO, GO, NT >
 Map specialization used by this class and subclasses.
 

Public Member Functions

 Transfer (const Teuchos::RCP< const map_type > &source, const Teuchos::RCP< const map_type > &target, const Teuchos::RCP< Teuchos::FancyOStream > &out, const Teuchos::RCP< Teuchos::ParameterList > &plist, const std::string &className)
 Four-argument constructor (most often used).
 
 Transfer (const Transfer< LO, GO, NT > &rhs, reverse_tag tag)
 Reverse-mode "copy" constructor.
 
virtual ~Transfer ()=default
 Destructor (declared virtual for memory safety of derived classes).
 
size_t getNumSameIDs () const
 Number of initial identical IDs.
 
size_t getNumPermuteIDs () const
 Number of IDs to permute but not to communicate.
 
Kokkos::DualView< const LO *, device_type > getPermuteFromLIDs_dv () const
 List of local IDs in the source Map that are permuted, as a const DualView (that is sync'd to both host and device).
 
Teuchos::ArrayView< const LO > getPermuteFromLIDs () const
 List of local IDs in the source Map that are permuted.
 
Kokkos::DualView< const LO *, device_type > getPermuteToLIDs_dv () const
 List of local IDs in the target Map that are permuted, as a const DualView (that is sync'd to both host and device).
 
Teuchos::ArrayView< const LO > 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.
 
Kokkos::DualView< const LO *, device_type > getRemoteLIDs_dv () const
 List of entries in the target Map to receive from other processes, as a const DualView (that is sync'd to both host and device).
 
Teuchos::ArrayView< const LO > 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.
 
Kokkos::DualView< const LO *, device_type > getExportLIDs_dv () const
 List of entries in the source Map that will be sent to other processes, as a const DualView (that is sync'd to both host and device).
 
Teuchos::ArrayView< const LO > getExportLIDs () const
 List of entries in the source Map that will be sent to other processes.
 
Teuchos::ArrayView< const int > getExportPIDs () const
 List of processes to which entries will be sent.
 
Teuchos::RCP< const map_typegetSourceMap () const
 The source Map used to construct this Export or Import.
 
Teuchos::RCP< const map_typegetTargetMap () const
 The target Map used to construct this Export or Import.
 
::Tpetra::DistributorgetDistributor () const
 The Distributor that this Export or Import object uses to move data.
 
bool isLocallyComplete () const
 Is this Export or Import locally complete?
 
bool isLocallyFitted () const
 Are source and target map locally fitted?
 
virtual void describe (Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
 Describe this object in a human-readable way to the given output stream.
 

Protected Member Functions

Teuchos::FancyOStream & verboseOutputStream () const
 Valid (nonnull) output stream for verbose output.
 
bool verbose () const
 Whether to print verbose debugging output.
 
void describeImpl (Teuchos::FancyOStream &out, const std::string &className, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
 Implementation of describe() for subclasses (Tpetra::Import and Tpetra::Export).
 

Protected Attributes

Teuchos::RCP< ImportExportData< LO, GO, NT > > TransferData_
 All the data needed for executing the Export communication plan.
 

Detailed Description

template<class LO, class GO, class NT>
class Tpetra::Details::Transfer< LO, GO, NT >

Common base class of Import and Export.

Warning
This is an implementation detail of Tpetra. We make no promises of backwards compatibility with this class.

Definition at line 82 of file Tpetra_Details_Transfer_decl.hpp.

Member Typedef Documentation

◆ map_type

template<class LO , class GO , class NT >
using Tpetra::Details::Transfer< LO, GO, NT >::map_type = ::Tpetra::Map<LO, GO, NT>

Map specialization used by this class and subclasses.

The initial two colons avoid confusion between Tpetra::Map and Tpetra::Details::Map.

Definition at line 88 of file Tpetra_Details_Transfer_decl.hpp.

Constructor & Destructor Documentation

◆ Transfer() [1/2]

template<class LO , class GO , class NT >
Tpetra::Details::Transfer< LO, GO, NT >::Transfer ( const Teuchos::RCP< const map_type > &  source,
const Teuchos::RCP< const map_type > &  target,
const Teuchos::RCP< Teuchos::FancyOStream > &  out,
const Teuchos::RCP< Teuchos::ParameterList > &  plist,
const std::string &  className 
)

Four-argument constructor (most often used).

Precondition
! source.is_null()
Parameters
source[in] Source Map of the Export or Import.
target[in] Target Map of the Export or Import. May be null only if Export or Import is using one of the special source-Map-only constructors.
out[in/out] Stream for verbose debugging output. If null, Transfer will wrap and use std::cerr.
plist[in/out] Parameters; may be null.
className[in] Either "Export" or "Import". Used to control verbose debugging output (sometimes you might want it only for one or the other class).

Definition at line 101 of file Tpetra_Details_Transfer_def.hpp.

◆ Transfer() [2/2]

template<class LO , class GO , class NT >
Tpetra::Details::Transfer< LO, GO, NT >::Transfer ( const Transfer< LO, GO, NT > &  rhs,
reverse_tag  tag 
)

Reverse-mode "copy" constructor.

Use this for constructing an Export from an Import, or an Import from an Export.

Definition at line 114 of file Tpetra_Details_Transfer_def.hpp.

◆ ~Transfer()

template<class LO , class GO , class NT >
virtual Tpetra::Details::Transfer< LO, GO, NT >::~Transfer ( )
virtualdefault

Destructor (declared virtual for memory safety of derived classes).

Member Function Documentation

◆ getNumSameIDs()

template<class LO , class GO , class NT >
size_t Tpetra::Details::Transfer< LO, GO, NT >::getNumSameIDs

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 149 of file Tpetra_Details_Transfer_def.hpp.

◆ getNumPermuteIDs()

template<class LO , class GO , class NT >
size_t Tpetra::Details::Transfer< LO, GO, NT >::getNumPermuteIDs

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 or Export will permute these entries locally (without distributed-memory communication).

Definition at line 156 of file Tpetra_Details_Transfer_def.hpp.

◆ getPermuteFromLIDs_dv()

template<class LO , class GO , class NT >
Kokkos::DualView< const LO *, typename Transfer< LO, GO, NT >::device_type > Tpetra::Details::Transfer< LO, GO, NT >::getPermuteFromLIDs_dv

List of local IDs in the source Map that are permuted, as a const DualView (that is sync'd to both host and device).

Definition at line 163 of file Tpetra_Details_Transfer_def.hpp.

◆ getPermuteFromLIDs()

template<class LO , class GO , class NT >
Teuchos::ArrayView< const LO > Tpetra::Details::Transfer< LO, GO, NT >::getPermuteFromLIDs

List of local IDs in the source Map that are permuted.

Definition at line 179 of file Tpetra_Details_Transfer_def.hpp.

◆ getPermuteToLIDs_dv()

template<class LO , class GO , class NT >
Kokkos::DualView< const LO *, typename Transfer< LO, GO, NT >::device_type > Tpetra::Details::Transfer< LO, GO, NT >::getPermuteToLIDs_dv

List of local IDs in the target Map that are permuted, as a const DualView (that is sync'd to both host and device).

Definition at line 186 of file Tpetra_Details_Transfer_def.hpp.

◆ getPermuteToLIDs()

template<class LO , class GO , class NT >
Teuchos::ArrayView< const LO > Tpetra::Details::Transfer< LO, GO, NT >::getPermuteToLIDs

List of local IDs in the target Map that are permuted.

Definition at line 202 of file Tpetra_Details_Transfer_def.hpp.

◆ getNumRemoteIDs()

template<class LO , class GO , class NT >
size_t Tpetra::Details::Transfer< LO, GO, NT >::getNumRemoteIDs

Number of entries not on the calling process.

Definition at line 209 of file Tpetra_Details_Transfer_def.hpp.

◆ getRemoteLIDs_dv()

template<class LO , class GO , class NT >
Kokkos::DualView< const LO *, typename Transfer< LO, GO, NT >::device_type > Tpetra::Details::Transfer< LO, GO, NT >::getRemoteLIDs_dv

List of entries in the target Map to receive from other processes, as a const DualView (that is sync'd to both host and device).

Definition at line 216 of file Tpetra_Details_Transfer_def.hpp.

◆ getRemoteLIDs()

template<class LO , class GO , class NT >
Teuchos::ArrayView< const LO > Tpetra::Details::Transfer< LO, GO, NT >::getRemoteLIDs

List of entries in the target Map to receive from other processes.

Definition at line 232 of file Tpetra_Details_Transfer_def.hpp.

◆ getNumExportIDs()

template<class LO , class GO , class NT >
size_t Tpetra::Details::Transfer< LO, GO, NT >::getNumExportIDs

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

Definition at line 239 of file Tpetra_Details_Transfer_def.hpp.

◆ getExportLIDs_dv()

template<class LO , class GO , class NT >
Kokkos::DualView< const LO *, typename Transfer< LO, GO, NT >::device_type > Tpetra::Details::Transfer< LO, GO, NT >::getExportLIDs_dv

List of entries in the source Map that will be sent to other processes, as a const DualView (that is sync'd to both host and device).

Definition at line 246 of file Tpetra_Details_Transfer_def.hpp.

◆ getExportLIDs()

template<class LO , class GO , class NT >
Teuchos::ArrayView< const LO > Tpetra::Details::Transfer< LO, GO, NT >::getExportLIDs

List of entries in the source Map that will be sent to other processes.

Definition at line 262 of file Tpetra_Details_Transfer_def.hpp.

◆ getExportPIDs()

template<class LO , class GO , class NT >
Teuchos::ArrayView< const int > Tpetra::Details::Transfer< LO, GO, NT >::getExportPIDs

List of processes to which entries will be sent.

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

Definition at line 269 of file Tpetra_Details_Transfer_def.hpp.

◆ getSourceMap()

template<class LO , class GO , class NT >
Teuchos::RCP< const typename Transfer< LO, GO, NT >::map_type > Tpetra::Details::Transfer< LO, GO, NT >::getSourceMap

The source Map used to construct this Export or Import.

Definition at line 276 of file Tpetra_Details_Transfer_def.hpp.

◆ getTargetMap()

template<class LO , class GO , class NT >
Teuchos::RCP< const typename Transfer< LO, GO, NT >::map_type > Tpetra::Details::Transfer< LO, GO, NT >::getTargetMap

The target Map used to construct this Export or Import.

Definition at line 283 of file Tpetra_Details_Transfer_def.hpp.

◆ getDistributor()

template<class LO , class GO , class NT >
Tpetra::Distributor & Tpetra::Details::Transfer< LO, GO, NT >::getDistributor

The Distributor that this Export or Import object uses to move data.

Definition at line 290 of file Tpetra_Details_Transfer_def.hpp.

◆ isLocallyComplete()

template<class LO , class GO , class NT >
bool Tpetra::Details::Transfer< LO, GO, NT >::isLocallyComplete

Is this Export or Import locally complete?

If this is an Export, then do all source Map indices on the calling process exist on at least one process (not necessarily this one) in the target Map?

If this is an Import, then do all target Map indices on the calling process exist on at least one process (not necessarily this one) in the source Map?

It's not necessarily an error for an Export or Import not to be locally complete on one or more processes. For example, this may happen in the common use case of "restriction" – that is, taking a subset of a large object. Nevertheless, you may find this predicate useful for figuring out whether you set up your Maps in the way that you expect.

Definition at line 297 of file Tpetra_Details_Transfer_def.hpp.

◆ isLocallyFitted()

template<class LO , class GO , class NT >
bool Tpetra::Details::Transfer< LO, GO, NT >::isLocallyFitted

Are source and target map locally fitted?

Returns whether source and target map are locally fitted on the calling rank. This is can be more efficient that calling isLocallyFitted() on the maps directly, since no indices need to be compared.

Definition at line 304 of file Tpetra_Details_Transfer_def.hpp.

◆ describe()

template<class LO , class GO , class NT >
void Tpetra::Details::Transfer< LO, GO, NT >::describe ( Teuchos::FancyOStream &  out,
const Teuchos::EVerbosityLevel  verbLevel = Teuchos::Describable::verbLevel_default 
) const
virtual

Describe this object in a human-readable way to the given output stream.

You must call this method as a collective over all processes in the communicator of the source and target Map of this object.

Parameters
out[out] Output stream to which to write. Only Process 0 in this object's communicator may write to the output stream.
verbLevel[in] Verbosity level. This also controls whether this method does any communication. At verbosity levels higher (greater) than Teuchos::VERB_LOW, this method behaves as a collective over the object's communicator.

Teuchos::FancyOStream wraps std::ostream. It adds features like tab levels. If you just want to wrap std::cout, try this:

auto out = Teuchos::getFancyOStream (Teuchos::rcpFromRef (std::out));

Reimplemented in Tpetra::Export< LocalOrdinal, GlobalOrdinal, Node >, and Tpetra::Import< LocalOrdinal, GlobalOrdinal, Node >.

Definition at line 364 of file Tpetra_Details_Transfer_def.hpp.

◆ verboseOutputStream()

template<class LO , class GO , class NT >
Teuchos::FancyOStream & Tpetra::Details::Transfer< LO, GO, NT >::verboseOutputStream
protected

Valid (nonnull) output stream for verbose output.

Definition at line 373 of file Tpetra_Details_Transfer_def.hpp.

◆ verbose()

template<class LO , class GO , class NT >
bool Tpetra::Details::Transfer< LO, GO, NT >::verbose
protected

Whether to print verbose debugging output.

Definition at line 383 of file Tpetra_Details_Transfer_def.hpp.

◆ describeImpl()

template<class LO , class GO , class NT >
void Tpetra::Details::Transfer< LO, GO, NT >::describeImpl ( Teuchos::FancyOStream &  out,
const std::string &  className,
const Teuchos::EVerbosityLevel  verbLevel = Teuchos::Describable::verbLevel_default 
) const
protected

Implementation of describe() for subclasses (Tpetra::Import and Tpetra::Export).

Parameters
out[out] Output stream to which to write. Only Process 0 in this object's communicator may write to the output stream.
className[in] Name of the subclass of Transfer calling this method.
verbLevel[in] Verbosity level. This also controls whether this method does any communication. At verbosity levels higher (greater) than Teuchos::VERB_LOW, this method behaves as a collective over the object's communicator.

Definition at line 390 of file Tpetra_Details_Transfer_def.hpp.

Member Data Documentation

◆ TransferData_

template<class LO , class GO , class NT >
Teuchos::RCP<ImportExportData<LO, GO, NT> > Tpetra::Details::Transfer< LO, GO, NT >::TransferData_
protected

All the data needed for executing the Export communication plan.

Definition at line 271 of file Tpetra_Details_Transfer_decl.hpp.


The documentation for this class was generated from the following files: