Tpetra parallel linear algebra
Version of the Day
|
Implement mapping from global ID to process ID and local ID. More...
#include <Tpetra_Directory_decl.hpp>
Inherits Describable.
Public Types | |
typedef Map< LocalOrdinal, GlobalOrdinal, Node > | map_type |
Type of the Map specialization to give to the constructor. More... | |
Public Member Functions | |||||
Constructors/Destructor. | |||||
Directory () | |||||
Default constructor: the only one you should use. More... | |||||
~Directory () | |||||
Destructor. More... | |||||
void | initialize (const map_type &map) | ||||
Initialize the Directory with its Map. More... | |||||
void | initialize (const map_type &map, const Tpetra::Details::TieBreak< LocalOrdinal, GlobalOrdinal > &tieBreak) | ||||
Initialize the Directory, with its Map and a TieBreak object. More... | |||||
bool | initialized () const | ||||
Whether the Directory is initialized. More... | |||||
Implementation of Teuchos::Describable. | |||||
Clone the Directory for a different Node type, using a cloned Map.
"Clone" in this case means make a shallow copy of the data, except for the Kokkos Node instance, which is distinct (and may even have a different type). Both Map and Directory provide clone(). Cloning is much faster than creating a Map or Directory with exactly the same data but a different Node instance. It is useful for creating a copy of a Tpetra object such as a MultiVector or CrsMatrix (distributed over a given Map) for a different Kokkos Node type, for example if creating a host (CPU) copy of a device (GPU) object. | |||||
std::string | description () const | ||||
A one-line human-readable description of this object. More... | |||||
Query methods. | |||||
LookupStatus | getDirectoryEntries (const map_type &map, const Teuchos::ArrayView< const GlobalOrdinal > &globalIDs, const Teuchos::ArrayView< int > &nodeIDs) const | ||||
Given a global ID list, return the list of their owning process IDs. More... | |||||
LookupStatus | getDirectoryEntries (const map_type &map, const Teuchos::ArrayView< const GlobalOrdinal > &globalIDs, const Teuchos::ArrayView< int > &nodeIDs, const Teuchos::ArrayView< LocalOrdinal > &localIDs) const | ||||
Given a global ID list, return a list of their owning process IDs and their corresponding local IDs. More... | |||||
bool | isOneToOne (const map_type &map) const | ||||
Whether the Directory's input Map is (globally) one to one. More... | |||||
Implement mapping from global ID to process ID and local ID.
This class is an implementation detail of Map. It is mainly of interest to Tpetra developers and does not normally appear in users' code. If using this with a Map, the template parameters of Directory should always be the same as the template parameters of Map.
LocalOrdinal | The type of local indices. See the documentation of Map for requirements. |
GlobalOrdinal | The type of global indices. See the documentation of Map for requirements. |
Node | The Kokkos Node type. See the documentation of Map for requirements. |
Directory implements looking up the process IDs and local IDs corresponding to a given list of global IDs. Each Map owns a Directory object that does this. Map::getRemoteIndexList() calls the Map's directory's getDirectoryEntries() method directly. Directory has four different ways to perform this lookup, depending on the kind of Map.
This class is templated on the same LocalOrdinal
and GlobalOrdinal
types on which Map is templated. Just as with Map, the LocalOrdinal
type defaults to int
if omitted. The GlobalOrdinal
type defaults to the LocalOrdinal
type, and the Node
type defaults to Kokkos' default Node type.
Definition at line 94 of file Tpetra_Directory_decl.hpp.
typedef Map<LocalOrdinal, GlobalOrdinal, Node> Tpetra::Directory< LocalOrdinal, GlobalOrdinal, Node >::map_type |
Type of the Map specialization to give to the constructor.
Definition at line 97 of file Tpetra_Directory_decl.hpp.
Tpetra::Directory< LO, GO, NT >::Directory | ( | ) |
Default constructor: the only one you should use.
To initialize the Directory, call the appropriate initialize() overload.
Definition at line 21 of file Tpetra_Directory_def.hpp.
Tpetra::Directory< LO, GO, NT >::~Directory | ( | ) |
Destructor.
Definition at line 26 of file Tpetra_Directory_def.hpp.
void Tpetra::Directory< LocalOrdinal, GlobalOrdinal, Node >::initialize | ( | const map_type & | map | ) |
void Tpetra::Directory< LocalOrdinal, GlobalOrdinal, Node >::initialize | ( | const map_type & | map, |
const Tpetra::Details::TieBreak< LocalOrdinal, GlobalOrdinal > & | tieBreak | ||
) |
bool Tpetra::Directory< LO, GO, NT >::initialized | ( | ) | const |
Whether the Directory is initialized.
Definition at line 35 of file Tpetra_Directory_def.hpp.
std::string Tpetra::Directory< LO, GO, NT >::description | ( | ) | const |
A one-line human-readable description of this object.
Definition at line 238 of file Tpetra_Directory_def.hpp.
LookupStatus Tpetra::Directory< LocalOrdinal, GlobalOrdinal, Node >::getDirectoryEntries | ( | const map_type & | map, |
const Teuchos::ArrayView< const GlobalOrdinal > & | globalIDs, | ||
const Teuchos::ArrayView< int > & | nodeIDs | ||
) | const |
Given a global ID list, return the list of their owning process IDs.
Given a list globalIDs
of global identifiers (GIDs), return the corresponding list nodeIDs
of the process ranks which own those GIDs. Tpetra uses this to figure out the locations of nonlocal Map entries.
map | [in] The Map given to this Directory instance's constructor. |
globalIDs | [in] List of global IDs to look up. |
nodeIDs | [out] On input, an array view with the same number of entries as globalIDs . On output, nodeIDs[i] is the ID of the process which owns globalIDs[i]. If globalIDs[i] is not present in the directory (i.e., is not owned by any process in the Directory's communicator), nodeIDs[i] is -1. |
nodeIDs.size() != globalIDs.size()
, then this method throws std::runtime_error. LookupStatus Tpetra::Directory< LocalOrdinal, GlobalOrdinal, Node >::getDirectoryEntries | ( | const map_type & | map, |
const Teuchos::ArrayView< const GlobalOrdinal > & | globalIDs, | ||
const Teuchos::ArrayView< int > & | nodeIDs, | ||
const Teuchos::ArrayView< LocalOrdinal > & | localIDs | ||
) | const |
Given a global ID list, return a list of their owning process IDs and their corresponding local IDs.
Given a list globalIDs
of global identifiers (GIDs), return the corresponding list nodeIDs
of the process ranks which own those GIDs, as well as the list of the local identifiers (LIDs). Tpetra uses this to figure out the locations of nonlocal Map entries.
map | [in] The Map given to this Directory instance's constructor. |
globalIDs | [in] List of global IDs to look up. |
nodeIDs | [out] On input, an array view with the same number of entries as globalIDs . On output, nodeIDs[i] is the ID of the process which owns globalIDs[i]. If globalIDs[i] is not present in the directory (i.e., is not owned by any process in the Directory's communicator), then nodeIDs[i] == -1 . |
localIDs | [out] On input, an array view with the same number of entries as globalIDs . On output, localIDs [i] is the local identifier corresponding to the global identifier globalIDs [i]. If globalIDs[i] is not present in the directory, then localIDs[i] == Teuchos::OrdinalTraits<LocalOrdinal>::invalid() . |
nodeIDs.size() != globalIDs.size()
or localIDs.size() != globalIDs.size()
, then this method throws std::runtime_error. bool Tpetra::Directory< LocalOrdinal, GlobalOrdinal, Node >::isOneToOne | ( | const map_type & | map | ) | const |