|
Tpetra Matrix/Vector Services Version of the Day
|
A class for partitioning distributed objects. More...
#include <Tpetra_Map_decl.hpp>

Public Member Functions | |
Constructor/Destructor Methods | |
| Map (global_size_t numGlobalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, LocalGlobal lg=GloballyDistributed, const Teuchos::RCP< Node > &node=Kokkos::DefaultNode::getDefaultNode()) | |
| Map constructor with Tpetra-defined contiguous uniform distribution. | |
| Map (global_size_t numGlobalElements, size_t numLocalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node=Kokkos::DefaultNode::getDefaultNode()) | |
| Map constructor with a user-defined contiguous distribution. | |
| Map (global_size_t numGlobalElements, const Teuchos::ArrayView< const GlobalOrdinal > &elementList, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node=Kokkos::DefaultNode::getDefaultNode()) | |
| Map constructor with user-defined non-contiguous (arbitrary) distribution. | |
| ~Map () | |
| Map destructor. | |
Map Attribute Methods | |
| global_size_t | getGlobalNumElements () const |
| The number of elements in this Map. | |
| size_t | getNodeNumElements () const |
| The number of elements belonging to the calling node. | |
| GlobalOrdinal | getIndexBase () const |
| The index base for this Map. | |
| LocalOrdinal | getMinLocalIndex () const |
| The minimum local index. | |
| LocalOrdinal | getMaxLocalIndex () const |
| The maximum local index. | |
| GlobalOrdinal | getMinGlobalIndex () const |
| The minimum global index owned by this node. | |
| GlobalOrdinal | getMaxGlobalIndex () const |
| The maximum global index owned by this node. | |
| GlobalOrdinal | getMinAllGlobalIndex () const |
| The minimum global index over all nodes. | |
| GlobalOrdinal | getMaxAllGlobalIndex () const |
| The maximum global index over all nodes. | |
| LocalOrdinal | getLocalElement (GlobalOrdinal globalIndex) const |
| The local index corresponding to the given global index. | |
| GlobalOrdinal | getGlobalElement (LocalOrdinal localIndex) const |
| The global index corresponding to the given local index. | |
| LookupStatus | getRemoteIndexList (const Teuchos::ArrayView< const GlobalOrdinal > &GIDList, const Teuchos::ArrayView< int > &nodeIDList, const Teuchos::ArrayView< LocalOrdinal > &LIDList) const |
| Return the node IDs and corresponding local IDs for a given list of global IDs. | |
| LookupStatus | getRemoteIndexList (const Teuchos::ArrayView< const GlobalOrdinal > &GIDList, const Teuchos::ArrayView< int > &nodeIDList) const |
| Return the node IDs for a given list of global IDs. | |
| Teuchos::ArrayView< const GlobalOrdinal > | getNodeElementList () const |
| Return a view of the global indices owned by this node. | |
| bool | isNodeLocalElement (LocalOrdinal localIndex) const |
| True if the local index is valid for this Map on this node, else false. | |
| bool | isNodeGlobalElement (GlobalOrdinal globalIndex) const |
| True if the global index is found in this Map on this node, else false. | |
| bool | isContiguous () const |
| True if this Map is distributed contiguously, else false. | |
| bool | isDistributed () const |
| Whether this Map is globally distributed or locally replicated. | |
Boolean Tests | |
| bool | isCompatible (const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const |
True if and only if map is compatible with this Map. | |
| bool | isSameAs (const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const |
True if and only if map is identical to this Map. | |
| const Teuchos::RCP< const Teuchos::Comm< int > > & | getComm () const |
| Get the Comm object for this Map. | |
| const Teuchos::RCP< Node > & | getNode () const |
| Get the Node object for this Map. | |
| std::string | description () const |
| Return a simple one-line description of this object. | |
| void | describe (Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const |
Print the object with some verbosity level to a FancyOStream object. | |
Related Functions | |
(Note that these are not member functions.) | |
| template<class LocalOrdinal , class GlobalOrdinal > | |
| Teuchos::RCP< const Map < LocalOrdinal, GlobalOrdinal, Kokkos::DefaultNode::DefaultNodeType > > | createLocalMap (size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm) |
| Non-member function to create a locally replicated Map with the default node. | |
| template<class LocalOrdinal , class GlobalOrdinal , class Node > | |
| Teuchos::RCP< const Map < LocalOrdinal, GlobalOrdinal, Node > > | createLocalMapWithNode (size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node) |
| Non-member function to create a locally replicated Map with a specified node. | |
| template<class LocalOrdinal , class GlobalOrdinal > | |
| Teuchos::RCP< const Map < LocalOrdinal, GlobalOrdinal, Kokkos::DefaultNode::DefaultNodeType > > | createUniformContigMap (global_size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm) |
| Non-member function to create a uniform, contiguous Map with the default node. | |
| template<class LocalOrdinal , class GlobalOrdinal , class Node > | |
| Teuchos::RCP< const Map < LocalOrdinal, GlobalOrdinal, Node > > | createUniformContigMapWithNode (global_size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node) |
| Non-member function to create a uniform, contiguous Map with a user-specified node. | |
| template<class LocalOrdinal , class GlobalOrdinal > | |
| Teuchos::RCP< const Map < LocalOrdinal, GlobalOrdinal, Kokkos::DefaultNode::DefaultNodeType > > | createContigMap (global_size_t numElements, size_t localNumElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm) |
| Non-member function to create a (potentially) non-uniform, contiguous Map with the default node. | |
| template<class LocalOrdinal , class GlobalOrdinal , class Node > | |
| Teuchos::RCP< const Map < LocalOrdinal, GlobalOrdinal, Node > > | createContigMapWithNode (global_size_t numElements, size_t localNumElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node) |
| Non-member function to create a (potentially) non-uniform, contiguous Map with a user-specified node. | |
| template<class LocalOrdinal , class GlobalOrdinal > | |
| Teuchos::RCP< const Map < LocalOrdinal, GlobalOrdinal, Kokkos::DefaultNode::DefaultNodeType > > | createNonContigMap (const ArrayView< const GlobalOrdinal > &elementList, const RCP< const Teuchos::Comm< int > > &comm) |
| Non-member function to create a non-contiguous Map with the default node. | |
| template<class LocalOrdinal , class GlobalOrdinal , class Node > | |
| Teuchos::RCP< const Map < LocalOrdinal, GlobalOrdinal, Node > > | createNonContigMapWithNode (const ArrayView< const GlobalOrdinal > &elementList, const RCP< const Teuchos::Comm< int > > &comm, const RCP< Node > &node) |
| Non-member function to create a non-contiguous Map with a user-specified node. | |
| template<class LocalOrdinal , class GlobalOrdinal , class Node > | |
| Teuchos::RCP< const Map < LocalOrdinal, GlobalOrdinal, Node > > | createWeightedContigMapWithNode (int thisNodeWeight, global_size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node) |
| Non-member function to create a contiguous Map with user-defined weights and a user-specified node. | |
| template<class LocalOrdinal , class GlobalOrdinal , class Node > | |
| bool | operator== (const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > &map1, const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > &map2) |
Returns true if map is identical to this map. Implemented in Tpetra::Map::isSameAs(). | |
| template<class LocalOrdinal , class GlobalOrdinal , class Node > | |
| bool | operator!= (const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > &map1, const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > &map2) |
Returns true if map is not identical to this map. Implemented in Tpetra::Map::isSameAs(). | |
A class for partitioning distributed objects.
This class is templated on LocalOrdinal and GlobalOrdinal. The GlobalOrdinal type, if omitted, defaults to the LocalOrdinal type.
CrsMatrix_BlockExtraction.cpp, LocalMatOpExample.cpp, and Tpetra_Power_Method.cpp.
Definition at line 69 of file Tpetra_Map_decl.hpp.
| Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >::Map | ( | global_size_t | numGlobalElements, |
| GlobalOrdinal | indexBase, | ||
| const Teuchos::RCP< const Teuchos::Comm< int > > & | comm, | ||
| LocalGlobal | lg = GloballyDistributed, |
||
| const Teuchos::RCP< Node > & | node = Kokkos::DefaultNode::getDefaultNode() |
||
| ) |
Map constructor with Tpetra-defined contiguous uniform distribution.
The elements are distributed among nodes so that the subsets of global elements are non-overlapping and contiguous and as evenly distributed across the nodes as possible.
| Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >::Map | ( | global_size_t | numGlobalElements, |
| size_t | numLocalElements, | ||
| GlobalOrdinal | indexBase, | ||
| const Teuchos::RCP< const Teuchos::Comm< int > > & | comm, | ||
| const Teuchos::RCP< Node > & | node = Kokkos::DefaultNode::getDefaultNode() |
||
| ) |
Map constructor with a user-defined contiguous distribution.
The elements are distributed among the nodes so that the subsets of global elements are non-overlapping and contiguous.
If numGlobalElements == Teuchos::OrdinalTraits<global_size_t>::invalid(), the number of global elements will be computed via a global communication. Otherwise, it must be equal to the sum of the local elements across all nodes. This will only be verified if Trilinos' Teuchos package was built with debug support (CMake Boolean option TEUCHOS_ENABLE_DEBUG=ON). If verification fails, a std::invalid_argument exception will be thrown.
| Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >::Map | ( | global_size_t | numGlobalElements, |
| const Teuchos::ArrayView< const GlobalOrdinal > & | elementList, | ||
| GlobalOrdinal | indexBase, | ||
| const Teuchos::RCP< const Teuchos::Comm< int > > & | comm, | ||
| const Teuchos::RCP< Node > & | node = Kokkos::DefaultNode::getDefaultNode() |
||
| ) |
Map constructor with user-defined non-contiguous (arbitrary) distribution.
If numGlobalElements == Teuchos::OrdinalTraits<global_size_t>::invalid(), the number of global elements will be computed via a global communication. Otherwise, it must be equal to the sum of the local elements across all nodes. This will only be verified if Trilinos' Teuchos package was built with debug support (CMake Boolean option TEUCHOS_ENABLE_DEBUG=ON). If verification fails, a std::invalid_argument exception will be thrown.
| Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >::~Map | ( | ) |
Map destructor.
| global_size_t Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >::getGlobalNumElements | ( | ) | const [inline] |
The number of elements in this Map.
Definition at line 135 of file Tpetra_Map_decl.hpp.
| size_t Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >::getNodeNumElements | ( | ) | const [inline] |
The number of elements belonging to the calling node.
Definition at line 138 of file Tpetra_Map_decl.hpp.
| GlobalOrdinal Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >::getIndexBase | ( | ) | const [inline] |
The index base for this Map.
Definition at line 141 of file Tpetra_Map_decl.hpp.
| LocalOrdinal Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >::getMinLocalIndex | ( | ) | const [inline] |
The minimum local index.
Definition at line 144 of file Tpetra_Map_decl.hpp.
| LocalOrdinal Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >::getMaxLocalIndex | ( | ) | const [inline] |
The maximum local index.
Definition at line 147 of file Tpetra_Map_decl.hpp.
| GlobalOrdinal Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >::getMinGlobalIndex | ( | ) | const [inline] |
The minimum global index owned by this node.
Definition at line 150 of file Tpetra_Map_decl.hpp.
| GlobalOrdinal Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >::getMaxGlobalIndex | ( | ) | const [inline] |
The maximum global index owned by this node.
Definition at line 153 of file Tpetra_Map_decl.hpp.
| GlobalOrdinal Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >::getMinAllGlobalIndex | ( | ) | const [inline] |
The minimum global index over all nodes.
Definition at line 156 of file Tpetra_Map_decl.hpp.
| GlobalOrdinal Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >::getMaxAllGlobalIndex | ( | ) | const [inline] |
The maximum global index over all nodes.
Definition at line 159 of file Tpetra_Map_decl.hpp.
| LocalOrdinal Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >::getLocalElement | ( | GlobalOrdinal | globalIndex | ) | const |
The local index corresponding to the given global index.
If the given global index is not owned by this node, return Teuchos::OrdinalTraits<LocalOrdinal>::invalid().
| GlobalOrdinal Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >::getGlobalElement | ( | LocalOrdinal | localIndex | ) | const |
The global index corresponding to the given local index.
If the given local index is not valid for this node, return Teuchos::OrdinalTraits<GlobalOrdinal>::invalid().
| LookupStatus Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >::getRemoteIndexList | ( | const Teuchos::ArrayView< const GlobalOrdinal > & | GIDList, |
| const Teuchos::ArrayView< int > & | nodeIDList, | ||
| const Teuchos::ArrayView< LocalOrdinal > & | LIDList | ||
| ) | const |
Return the node IDs and corresponding local IDs for a given list of global IDs.
| LookupStatus Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >::getRemoteIndexList | ( | const Teuchos::ArrayView< const GlobalOrdinal > & | GIDList, |
| const Teuchos::ArrayView< int > & | nodeIDList | ||
| ) | const |
Return the node IDs for a given list of global IDs.
| Teuchos::ArrayView<const GlobalOrdinal> Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >::getNodeElementList | ( | ) | const |
Return a view of the global indices owned by this node.
| bool Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >::isNodeLocalElement | ( | LocalOrdinal | localIndex | ) | const |
True if the local index is valid for this Map on this node, else false.
| bool Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >::isNodeGlobalElement | ( | GlobalOrdinal | globalIndex | ) | const |
True if the global index is found in this Map on this node, else false.
| bool Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >::isContiguous | ( | ) | const |
True if this Map is distributed contiguously, else false.
Currently, creating this Map using the constructor for a user-defined arbitrary distribution (that takes a list of global elements owned on each process) means that this method always returns false. We currently make no effort to test whether the user-provided global indices are actually contiguous on all the processes. Many operations may be faster for contiguous Maps. Thus, if you know the indices are contiguous on all processes, you should consider using one of the constructors for contiguous elements.
| bool Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >::isDistributed | ( | ) | const |
Whether this Map is globally distributed or locally replicated.
"Globally distributed" means that all of the following are true:
1. The map's communicator has more than one process.
2. There is at least one process in the map's communicator, whose local number of elements does not equal the number of global elements. (That is, not all the elements are replicated over all the processes.)
If at least one of the above are not true, then the map is "locally replicated." (The two are mutually exclusive.)
Calling this method requires no communication or computation, because the result is precomputed in Map's constructors.
| bool Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >::isCompatible | ( | const Map< LocalOrdinal, GlobalOrdinal, Node > & | map | ) | const |
True if and only if map is compatible with this Map.
Two Maps are "compatible" if all of the following are true: 1. They have the same global number of elements. 2. They have the same number of local elements on each process.
Determining #2 requires communication (a reduction over this Map's communicator). This method assumes that the input Map is valid on all processes in this Map's communicator.
Compatibility is useful for determining correctness of certain operations, like assigning one MultiVector X to another Y. If X and Y have the same number of columns, and if their Maps are compatible, then it is legal to assign X to Y or to assign Y to X.
| bool Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >::isSameAs | ( | const Map< LocalOrdinal, GlobalOrdinal, Node > & | map | ) | const |
True if and only if map is identical to this Map.
"Identical" is stronger than "compatible." Two Maps are identical if all of the following are true: 1. They have the same min and max global indices. 2. They have the same global number of elements. 3. They are either both distributed, or both not distributed. 4. Their index bases are the same. 5. They have the same number of local elements on each process. 6. They have the same global indices on each process.
#2 and #5 are exactly "compatibility" (see isCompatible()). Thus, "identical" includes, but is stronger than, "compatible."
A Map corresponds to a "two-dimensional" or block permutation over process ranks and global element indices. Two Maps with different numbers of processes in their communicators cannot be compatible, let alone identical. Two identical Maps correspond to the same permutation.
| const Teuchos::RCP<const Teuchos::Comm<int> >& Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >::getComm | ( | ) | const |
Get the Comm object for this Map.
| const Teuchos::RCP<Node>& Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >::getNode | ( | ) | const |
Get the Node object for this Map.
| std::string Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >::description | ( | ) | const [virtual] |
Return a simple one-line description of this object.
Reimplemented from Teuchos::Describable.
| void Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >::describe | ( | Teuchos::FancyOStream & | out, |
| const Teuchos::EVerbosityLevel | verbLevel = Teuchos::Describable::verbLevel_default |
||
| ) | const [virtual] |
Print the object with some verbosity level to a FancyOStream object.
Reimplemented from Teuchos::Describable.
| Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Kokkos::DefaultNode::DefaultNodeType > > createLocalMap | ( | size_t | numElements, |
| const Teuchos::RCP< const Teuchos::Comm< int > > & | comm | ||
| ) | [related] |
Non-member function to create a locally replicated Map with the default node.
This method returns a Map instantiated on the Kokkos default node type, Kokkos::DefaultNode::DefaultNodeType.
The Map is configured to use zero-based indexing.
| Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createLocalMapWithNode | ( | size_t | numElements, |
| const Teuchos::RCP< const Teuchos::Comm< int > > & | comm, | ||
| const Teuchos::RCP< Node > & | node | ||
| ) | [related] |
| Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Kokkos::DefaultNode::DefaultNodeType > > createUniformContigMap | ( | global_size_t | numElements, |
| const Teuchos::RCP< const Teuchos::Comm< int > > & | comm | ||
| ) | [related] |
Non-member function to create a uniform, contiguous Map with the default node.
This method returns a Map instantiated on the Kokkos default node type, Kokkos::DefaultNode::DefaultNodeType.
The Map is configured to use zero-based indexing.
| Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createUniformContigMapWithNode | ( | global_size_t | numElements, |
| const Teuchos::RCP< const Teuchos::Comm< int > > & | comm, | ||
| const Teuchos::RCP< Node > & | node | ||
| ) | [related] |
| Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Kokkos::DefaultNode::DefaultNodeType > > createContigMap | ( | global_size_t | numElements, |
| size_t | localNumElements, | ||
| const Teuchos::RCP< const Teuchos::Comm< int > > & | comm | ||
| ) | [related] |
Non-member function to create a (potentially) non-uniform, contiguous Map with the default node.
This method returns a Map instantiated on the Kokkos default node type, Kokkos::DefaultNode::DefaultNodeType.
The Map is configured to use zero-based indexing.
| Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createContigMapWithNode | ( | global_size_t | numElements, |
| size_t | localNumElements, | ||
| const Teuchos::RCP< const Teuchos::Comm< int > > & | comm, | ||
| const Teuchos::RCP< Node > & | node | ||
| ) | [related] |
| Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Kokkos::DefaultNode::DefaultNodeType > > createNonContigMap | ( | const ArrayView< const GlobalOrdinal > & | elementList, |
| const RCP< const Teuchos::Comm< int > > & | comm | ||
| ) | [related] |
Non-member function to create a non-contiguous Map with the default node.
This method returns a Map instantiated on the Kokkos default node type, Kokkos::DefaultNode::DefaultNodeType.
The Map is configured to use zero-based indexing.
| Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createNonContigMapWithNode | ( | const ArrayView< const GlobalOrdinal > & | elementList, |
| const RCP< const Teuchos::Comm< int > > & | comm, | ||
| const RCP< Node > & | node | ||
| ) | [related] |
| Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createWeightedContigMapWithNode | ( | int | thisNodeWeight, |
| global_size_t | numElements, | ||
| const Teuchos::RCP< const Teuchos::Comm< int > > & | comm, | ||
| const Teuchos::RCP< Node > & | node | ||
| ) | [related] |
| bool operator== | ( | const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > & | map1, |
| const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > & | map2 | ||
| ) | [related] |
Returns true if map is identical to this map. Implemented in Tpetra::Map::isSameAs().
Definition at line 526 of file Tpetra_Map_decl.hpp.
| bool operator!= | ( | const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > & | map1, |
| const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > & | map2 | ||
| ) | [related] |
Returns true if map is not identical to this map. Implemented in Tpetra::Map::isSameAs().
Definition at line 533 of file Tpetra_Map_decl.hpp.
1.7.4