Tpetra parallel linear algebra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | List of all members
Tpetra::ImportExportData< LocalOrdinal, GlobalOrdinal, Node > Class Template Reference

Implementation detail of Import and Export. More...

#include <Tpetra_ImportExportData_decl.hpp>

Public Member Functions

 ImportExportData (const Teuchos::RCP< const map_type > &source, const Teuchos::RCP< const map_type > &target)
 Constructor. More...
 
 ImportExportData (const Teuchos::RCP< const map_type > &source, const Teuchos::RCP< const map_type > &target, const Teuchos::RCP< Teuchos::FancyOStream > &out)
 Constructor with output stream. More...
 
 ImportExportData (const Teuchos::RCP< const map_type > &source, const Teuchos::RCP< const map_type > &target, const Teuchos::RCP< Teuchos::ParameterList > &plist)
 Constructor with ParameterList for Distributor. More...
 
 ImportExportData (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)
 Constructor with output stream, and ParameterList for Distributor. More...
 
 ~ImportExportData ()=default
 Destructor. More...
 
Teuchos::RCP< ImportExportData
< LocalOrdinal, GlobalOrdinal,
Node > > 
reverseClone ()
 Copy the data, but reverse the direction of the transfer as well as reversing the Distributor. More...
 

Public Attributes

const Teuchos::RCP< const Map
< LocalOrdinal, GlobalOrdinal,
Node > > 
source_
 Source Map of the Import or Export. More...
 
const Teuchos::RCP< const Map
< LocalOrdinal, GlobalOrdinal,
Node > > 
target_
 Target Map of the Import or Export. More...
 
Teuchos::RCP
< Teuchos::FancyOStream > 
out_
 Output stream for verbose debugging output. More...
 
bool verbose_ = false
 Whether to print verbose debugging output. More...
 
Kokkos::DualView< LocalOrdinal
*, device_type > 
permuteToLIDs_
 Index of target Map LIDs to which to permute. More...
 
Kokkos::DualView< LocalOrdinal
*, device_type > 
permuteFromLIDs_
 Index of source Map LIDs from which to permute. More...
 
Kokkos::DualView< LocalOrdinal
*, device_type > 
remoteLIDs_
 "Incoming" indices. More...
 
Kokkos::DualView< LocalOrdinal
*, device_type > 
exportLIDs_
 "Outgoing" local indices. More...
 
Teuchos::Array< int > exportPIDs_
 Ranks of the processes to which the source object sends data. More...
 
size_t numSameIDs_
 Number of initial identical indices. More...
 
Distributor distributor_
 Object that actually distributes (sends and receives) data. More...
 
bool isLocallyComplete_
 Is this Export or Import locally complete? More...
 

Detailed Description

template<class LocalOrdinal, class GlobalOrdinal, class Node>
class Tpetra::ImportExportData< LocalOrdinal, GlobalOrdinal, Node >

Implementation detail of Import and Export.

Template Parameters
LocalOrdinalThe type of local indices. See the documentation of Map for requirements.
GlobalOrdinalThe type of global indices. See the documentation of Map for requirements.
NodeThe Kokkos Node type. See the documentation of Map for requirements.
Warning
This class is an implementation detail of Import and Export. It may change or disappear at any time. Tpetra users must not depend on this class.

Import and Export both require the same data. We use this class as a container for those data. They include incoming ("remote") and outgoing ("export") local indices (LIDs), LIDs to permute on the source and target of the Import or Export, and process ranks ("image IDs") to which to send.

Definition at line 83 of file Tpetra_ImportExportData_decl.hpp.

Constructor & Destructor Documentation

template<class LocalOrdinal , class GlobalOrdinal , class Node >
Tpetra::ImportExportData< LocalOrdinal, GlobalOrdinal, Node >::ImportExportData ( const Teuchos::RCP< const map_type > &  source,
const Teuchos::RCP< const map_type > &  target 
)

Constructor.

Parameters
source[in] Source Map of the Import or Export
target[in] Target Map of the Import or Export

Definition at line 70 of file Tpetra_ImportExportData_def.hpp.

template<class LocalOrdinal , class GlobalOrdinal , class Node >
Tpetra::ImportExportData< LocalOrdinal, GlobalOrdinal, Node >::ImportExportData ( const Teuchos::RCP< const map_type > &  source,
const Teuchos::RCP< const map_type > &  target,
const Teuchos::RCP< Teuchos::FancyOStream > &  out 
)

Constructor with output stream.

Parameters
source[in] Source Map of the Import or Export
target[in] Target Map of the Import or Export
out[in/out] Output stream (for debugging output)

Definition at line 77 of file Tpetra_ImportExportData_def.hpp.

template<class LocalOrdinal , class GlobalOrdinal , class Node >
Tpetra::ImportExportData< LocalOrdinal, GlobalOrdinal, Node >::ImportExportData ( const Teuchos::RCP< const map_type > &  source,
const Teuchos::RCP< const map_type > &  target,
const Teuchos::RCP< Teuchos::ParameterList > &  plist 
)

Constructor with ParameterList for Distributor.

Parameters
source[in] Source Map of the Import or Export
target[in] Target Map of the Import or Export
plist[in/out] List of parameters for the Distributor

Definition at line 85 of file Tpetra_ImportExportData_def.hpp.

template<class LocalOrdinal , class GlobalOrdinal , class Node >
Tpetra::ImportExportData< LocalOrdinal, GlobalOrdinal, Node >::ImportExportData ( 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 
)

Constructor with output stream, and ParameterList for Distributor.

Parameters
source[in] Source Map of the Import or Export
target[in] Target Map of the Import or Export
out[in/out] Output stream (for debugging output)
plist[in/out] List of parameters for the Distributor

Definition at line 54 of file Tpetra_ImportExportData_def.hpp.

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

Destructor.

Member Function Documentation

template<class LocalOrdinal , class GlobalOrdinal , class Node >
Teuchos::RCP< ImportExportData< LocalOrdinal, GlobalOrdinal, Node > > Tpetra::ImportExportData< LocalOrdinal, GlobalOrdinal, Node >::reverseClone ( )

Copy the data, but reverse the direction of the transfer as well as reversing the Distributor.

"Reverse the direction of the transfer" means that an Import becomes an Export in the opposite direction, and vice versa.

Definition at line 94 of file Tpetra_ImportExportData_def.hpp.

Member Data Documentation

template<class LocalOrdinal, class GlobalOrdinal, class Node>
const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > Tpetra::ImportExportData< LocalOrdinal, GlobalOrdinal, Node >::source_

Source Map of the Import or Export.

Definition at line 138 of file Tpetra_ImportExportData_decl.hpp.

template<class LocalOrdinal, class GlobalOrdinal, class Node>
const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > Tpetra::ImportExportData< LocalOrdinal, GlobalOrdinal, Node >::target_

Target Map of the Import or Export.

Definition at line 141 of file Tpetra_ImportExportData_decl.hpp.

template<class LocalOrdinal, class GlobalOrdinal, class Node>
Teuchos::RCP<Teuchos::FancyOStream> Tpetra::ImportExportData< LocalOrdinal, GlobalOrdinal, Node >::out_

Output stream for verbose debugging output.

Definition at line 144 of file Tpetra_ImportExportData_decl.hpp.

template<class LocalOrdinal, class GlobalOrdinal, class Node>
bool Tpetra::ImportExportData< LocalOrdinal, GlobalOrdinal, Node >::verbose_ = false

Whether to print verbose debugging output.

Definition at line 147 of file Tpetra_ImportExportData_decl.hpp.

template<class LocalOrdinal, class GlobalOrdinal, class Node>
Kokkos::DualView<LocalOrdinal*, device_type> Tpetra::ImportExportData< LocalOrdinal, GlobalOrdinal, Node >::permuteToLIDs_

Index of target Map LIDs to which to permute.

After the initial numSameIDs_ indices which are the same in both the source and target Map, zero or more global indices (GIDs) remain. They exist in both the source and target Maps, but are in a different order. Therefore, they may have different local indices (LIDs), and require permutation.

For each remaining GIDs g in the target Map, if the source Map also owns g, then permuteToLIDs_ gets the corresponding LID in the target Map.

Definition at line 165 of file Tpetra_ImportExportData_decl.hpp.

template<class LocalOrdinal, class GlobalOrdinal, class Node>
Kokkos::DualView<LocalOrdinal*, device_type> Tpetra::ImportExportData< LocalOrdinal, GlobalOrdinal, Node >::permuteFromLIDs_

Index of source Map LIDs from which to permute.

After the initial numSameIDs_ indices which are the same in both the source and target Map, zero or more global indices (GIDs) remain. They exist in both the source and target Maps, but are in a different order. Therefore, they may have different local indices (LIDs), and require permutation.

For each remaining GID g in the target Map, if the source Map also owns g, then permuteFromLIDs_ gets the corresponding LID in the source Map.

Definition at line 178 of file Tpetra_ImportExportData_decl.hpp.

template<class LocalOrdinal, class GlobalOrdinal, class Node>
Kokkos::DualView<LocalOrdinal*, device_type> Tpetra::ImportExportData< LocalOrdinal, GlobalOrdinal, Node >::remoteLIDs_

"Incoming" indices.

This array holds the LIDs of the GIDs that are owned by the target Map, but not by the source Map. The target object of the Import or Export will receive data for these LIDs from other processes.

Definition at line 186 of file Tpetra_ImportExportData_decl.hpp.

template<class LocalOrdinal, class GlobalOrdinal, class Node>
Kokkos::DualView<LocalOrdinal*, device_type> Tpetra::ImportExportData< LocalOrdinal, GlobalOrdinal, Node >::exportLIDs_

"Outgoing" local indices.

This array holds the LIDs of the GIDs that are owned by the source Map, but not by the target Map. The source object of the Import or Export will send data from these LIDs to other processes.

Definition at line 194 of file Tpetra_ImportExportData_decl.hpp.

template<class LocalOrdinal, class GlobalOrdinal, class Node>
Teuchos::Array<int> Tpetra::ImportExportData< LocalOrdinal, GlobalOrdinal, Node >::exportPIDs_

Ranks of the processes to which the source object sends data.

Definition at line 197 of file Tpetra_ImportExportData_decl.hpp.

template<class LocalOrdinal, class GlobalOrdinal, class Node>
size_t Tpetra::ImportExportData< LocalOrdinal, GlobalOrdinal, Node >::numSameIDs_

Number of initial identical indices.

The number of initial indices (IDs) that are identical between the source and target Maps. This count stops at the first different ID.

Note that we didn't specify whether the IDs are global (GID) or local (LID). That is because if the two Maps start with the same sequence of GIDs on the calling process, then those GIDs map to the same LIDs on the calling process. Thus, when we say "ID" in the previous paragraph, we include both GID and LID.

Definition at line 211 of file Tpetra_ImportExportData_decl.hpp.

template<class LocalOrdinal, class GlobalOrdinal, class Node>
Distributor Tpetra::ImportExportData< LocalOrdinal, GlobalOrdinal, Node >::distributor_

Object that actually distributes (sends and receives) data.

The Import or Export object that controls this ImportExportData container is responsible for initializing the Distributor. The Distributor's constructor just gives it the communicator; it does not complete initialization.

Definition at line 219 of file Tpetra_ImportExportData_decl.hpp.

template<class LocalOrdinal, class GlobalOrdinal, class Node>
bool Tpetra::ImportExportData< LocalOrdinal, GlobalOrdinal, Node >::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 237 of file Tpetra_ImportExportData_decl.hpp.


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