42 #ifndef TPETRA_MAP_DECL_HPP
43 #define TPETRA_MAP_DECL_HPP
45 #include <Kokkos_DefaultNode.hpp>
46 #include <Teuchos_Describable.hpp>
49 #include "Tpetra_ConfigDefs.hpp"
56 #ifndef HAVE_TPETRA_FIXED_HASH_TABLE
57 # define HAVE_TPETRA_FIXED_HASH_TABLE 1
58 #endif // HAVE_TPETRA_FIXED_HASH_TABLE
65 #ifndef DOXYGEN_SHOULD_SKIP_THIS
67 template <
class LO,
class GO,
class N>
class Directory;
69 # ifdef HAVE_TPETRA_FIXED_HASH_TABLE
71 template<
class GlobalOrdinal,
class LocalOrdinal>
76 template<
class GlobalOrdinal,
class LocalOrdinal>
79 # endif // HAVE_TPETRA_FIXED_HASH_TABLE
80 #endif // DOXYGEN_SHOULD_SKIP_THIS
188 template <
class LocalOrdinal,
189 class GlobalOrdinal = LocalOrdinal,
190 class Node = Kokkos::DefaultNode::DefaultNodeType>
248 GlobalOrdinal indexBase,
293 size_t numLocalElements,
294 GlobalOrdinal indexBase,
334 GlobalOrdinal indexBase,
603 template <
class Node2>
691 template <
class LO,
class GO,
class N>
friend class Map;
709 void setupDirectory ()
const;
725 bool checkIsDist()
const;
746 GlobalOrdinal indexBase_;
750 size_t numLocalElements_;
752 GlobalOrdinal minMyGID_, maxMyGID_;
754 GlobalOrdinal minAllGID_, maxAllGID_;
756 GlobalOrdinal firstContiguousGID_, lastContiguousGID_;
786 #ifdef HAVE_TPETRA_FIXED_HASH_TABLE
792 #endif // HAVE_TPETRA_FIXED_HASH_TABLE
850 template <
class LocalOrdinal,
class GlobalOrdinal>
870 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
884 template <
class LocalOrdinal,
class GlobalOrdinal>
894 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
908 template <
class LocalOrdinal,
class GlobalOrdinal>
911 size_t localNumElements,
920 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
923 size_t localNumElements,
935 template <
class LocalOrdinal,
class GlobalOrdinal>
946 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
950 const RCP<Node> &node);
958 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
971 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
977 #include "Tpetra_Directory_decl.hpp"
980 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
981 template <
class Node2>
982 RCP<const Map<LocalOrdinal, GlobalOrdinal, Node2> >
991 map->indexBase_ = indexBase_;
992 map->numGlobalElements_ = numGlobalElements_;
993 map->numLocalElements_ = numLocalElements_;
994 map->minMyGID_ = minMyGID_;
995 map->maxMyGID_ = maxMyGID_;
996 map->minAllGID_ = minAllGID_;
997 map->maxAllGID_ = maxAllGID_;
998 map->firstContiguousGID_= firstContiguousGID_;
999 map->lastContiguousGID_ = lastContiguousGID_;
1000 map->uniform_ = uniform_;
1001 map->contiguous_ = contiguous_;
1002 map->distributed_ = distributed_;
1003 map->lgMap_ = lgMap_;
1004 map->glMap_ = glMap_;
1011 if (! directory_.is_null ()) {
1013 map->directory_ = directory_->template clone<Node2> (map.
create_weak ());
1021 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
1028 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
1033 #endif // TPETRA_MAP_DECL_HPP
GlobalOrdinal getMinGlobalIndex() const
The minimum global index owned by the calling process.
bool isNodeGlobalElement(GlobalOrdinal globalIndex) const
Whether the given global index is valid for this Map on this process.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > replaceCommWithSubset(const Teuchos::RCP< const Teuchos::Comm< int > > &newComm) const
Replace this Map's communicator with a subset communicator.
GlobalOrdinal global_ordinal_type
The type of global indices.
bool isContiguous() const
True if this Map is distributed contiguously, else false.
const Teuchos::RCP< const Teuchos::Comm< int > > & getComm() const
Accessors for the Teuchos::Comm and Kokkos Node objects.
RCP< T > create_weak() const
bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is compatible with this Map.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Kokkos::DefaultNode::DefaultNodeType > > createNonContigMap(const ArrayView< const GlobalOrdinal > &elementList, const RCP< const Teuchos::Comm< int > > &comm)
Non-member constructor for a non-contiguous Map with the default Kokkos Node.
bool isUniform() const
Whether the range of global indices is uniform.
GlobalOrdinal getIndexBase() const
The index base for this Map.
bool isDistributed() const
Whether this Map is globally distributed or locally replicated.
LocalOrdinal getMinLocalIndex() const
The minimum local index.
bool operator!=(const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > &map1, const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > &map2)
True if map1 is not the same as (in the sense of isSameAs()) map2, else false.
GlobalOrdinal getMinAllGlobalIndex() const
The minimum global index over all processes in the communicator.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal > > createLocalMap(size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Nonmember constructor for a locally replicated Map with the default Kokkos 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 constructor for a (potentially) non-uniformly distributed, contiguous Map with a user-spec...
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node2 > > clone(const RCP< Node2 > &node2) const
Advanced methods.
bool isNodeLocalElement(LocalOrdinal localIndex) const
Whether the given local index is valid for this Map on this process.
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 constructor for a contiguous Map with user-defined weights and a user-specified Kokkos Nod...
GlobalOrdinal getMaxAllGlobalIndex() const
The maximum global index over all processes in the communicator.
size_t global_size_t
Global size_t object.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal > > createUniformContigMap(global_size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Non-member constructor for a uniformly distributed, contiguous Map with the default Kokkos Node...
GlobalOrdinal getGlobalElement(LocalOrdinal localIndex) const
The global index corresponding to the given local index.
GlobalOrdinal getMaxGlobalIndex() const
The maximum global index owned by the calling process.
LookupStatus getRemoteIndexList(const Teuchos::ArrayView< const GlobalOrdinal > &GIDList, const Teuchos::ArrayView< int > &nodeIDList, const Teuchos::ArrayView< LocalOrdinal > &LIDList) const
Return the process ranks and corresponding local indices for the given global indices.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > removeEmptyProcesses() const
Return a new Map with processes with zero elements removed.
Teuchos::ArrayView< const GlobalOrdinal > getNodeElementList() const
Return a view of the global indices owned by this process.
static const EVerbosityLevel verbLevel_default
bool operator==(const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > &map1, const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > &map2)
True if map1 is the same as (in the sense of isSameAs()) map2, else false.
Node node_type
The type of the Kokkos Node.
LocalOrdinal getLocalElement(GlobalOrdinal globalIndex) const
The local index corresponding to the given global index.
size_t getNodeNumElements() const
The number of elements belonging to the calling process.
Describes a parallel distribution of objects over processes.
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 constructor for a (potentially) non-uniformly distributed, contiguous Map with the default...
bool isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is identical to this Map.
LocalOrdinal local_ordinal_type
The type of local indices.
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 constructor for a non-contiguous Map with a user-specified Kokkos 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=Kokkos::Details::getNode< Node >())
Non-member constructor for a uniformly distributed, contiguous Map with a user-specified Kokkos Node...
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print this object with the given verbosity level to the given Teuchos::FancyOStream.
const Teuchos::RCP< Node > & getNode() const
Get this Map's Node object.
LocalOrdinal getMaxLocalIndex() const
The maximum local index on the calling process.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createLocalMapWithNode(size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node=Kokkos::Details::getNode< Node >())
Nonmember constructor for a locally replicated Map with a specified Kokkos Node.
global_size_t getGlobalNumElements() const
The number of elements in this Map.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createOneToOne(Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &M)
Creates a one-to-one version of the given Map where each GID is owned by only one process...
std::string description() const
Implementation of Teuchos::Describable.
Map()
Default constructor (that does nothing).