46 #ifndef XPETRA_TPETRAMAP_DEF_HPP
47 #define XPETRA_TPETRAMAP_DEF_HPP
56 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
59 GlobalOrdinal indexBase,
60 const Teuchos::RCP<
const Teuchos::Comm<int> > &comm,
62 : map_(Teuchos::rcp(new Tpetra::
Map<LocalOrdinal, GlobalOrdinal, Node>(numGlobalElements,
68 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
71 size_t numLocalElements,
72 GlobalOrdinal indexBase,
73 const Teuchos::RCP<
const Teuchos::Comm<int> > &comm)
74 : map_(Teuchos::rcp(new Tpetra::
Map<LocalOrdinal, GlobalOrdinal, Node>(numGlobalElements,
80 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
83 const Teuchos::ArrayView<const GlobalOrdinal> &elementList,
84 GlobalOrdinal indexBase,
85 const Teuchos::RCP<
const Teuchos::Comm<int> > &comm)
86 : map_(Teuchos::rcp(new Tpetra::
Map<LocalOrdinal, GlobalOrdinal, Node>(numGlobalElements,
91 #ifdef HAVE_XPETRA_TPETRA
94 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
97 const Kokkos::View<const GlobalOrdinal *, typename Node::device_type> &indexList,
98 GlobalOrdinal indexBase,
99 const Teuchos::RCP<
const Teuchos::Comm<int> > &comm)
100 : map_(Teuchos::rcp(new Tpetra::
Map<LocalOrdinal, GlobalOrdinal, Node>(numGlobalElements,
107 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
112 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
115 return map_->getGlobalNumElements();
118 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
121 return map_->getLocalNumElements();
124 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
127 return map_->getIndexBase();
130 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
133 return map_->getMinLocalIndex();
136 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
139 return map_->getMaxLocalIndex();
142 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
145 return map_->getMinGlobalIndex();
148 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
151 return map_->getMaxGlobalIndex();
154 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
157 return map_->getMinAllGlobalIndex();
160 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
163 return map_->getMaxAllGlobalIndex();
166 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
169 return map_->getLocalElement(globalIndex);
172 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
175 return map_->getGlobalElement(localIndex);
178 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
181 return toXpetra(map_->getRemoteIndexList(GIDList, nodeIDList, LIDList));
184 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
187 return toXpetra(map_->getRemoteIndexList(GIDList, nodeIDList));
190 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
193 return map_->getLocalElementList();
196 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
199 return map_->getMyGlobalIndicesDevice();
202 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
205 return map_->isNodeLocalElement(localIndex);
208 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
211 return map_->isNodeGlobalElement(globalIndex);
214 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
217 return map_->isContiguous();
220 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
223 return map_->isDistributed();
226 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
229 return map_->isCompatible(
toTpetra(map));
232 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
235 return map_->isSameAs(
toTpetra(map));
238 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
241 return map_->getComm();
244 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
247 return map_->description();
250 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
253 map_->describe(out, verbLevel);
256 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
258 return toXpetra(map_->removeEmptyProcesses());
261 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
263 return toXpetra(map_->replaceCommWithSubset(newComm));
266 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
270 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
273 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
276 #ifdef HAVE_XPETRA_TPETRA
278 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
280 return map_->getLocalMap();
284 #ifdef HAVE_XPETRA_EPETRA
286 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \
287 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT))))
292 :
public virtual Map<int, int, EpetraNode> {
305 const Teuchos::RCP<
const Teuchos::Comm<int> > &comm,
313 size_t numLocalElements,
315 const Teuchos::RCP<
const Teuchos::Comm<int> > &comm) {
322 const Teuchos::ArrayView<const GlobalOrdinal> &elementList,
324 const Teuchos::RCP<
const Teuchos::Comm<int> > &comm) {
376 Teuchos::ArrayView<const GlobalOrdinal>
getLocalElementList()
const {
return Teuchos::ArrayView<const GlobalOrdinal>(); }
407 Teuchos::RCP<const Teuchos::Comm<int> >
getComm()
const {
return Teuchos::null; }
418 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default)
const {}
421 RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
replaceCommWithSubset(
const Teuchos::RCP<
const Teuchos::Comm<int> > &newComm)
const {
return Teuchos::null; }
429 TpetraMap(
const Teuchos::RCP<
const Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node> > &map) {
437 RCP<const Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node> >
getTpetra_Map()
const {
return Teuchos::null; }
439 #ifdef HAVE_XPETRA_TPETRA
452 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
453 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
457 :
public virtual Map<int, long long, EpetraNode> {
469 const Teuchos::RCP<
const Teuchos::Comm<int> > &comm,
476 size_t numLocalElements,
478 const Teuchos::RCP<
const Teuchos::Comm<int> > &comm) {
484 const Teuchos::ArrayView<const GlobalOrdinal> &elementList,
486 const Teuchos::RCP<
const Teuchos::Comm<int> > &comm) {
538 Teuchos::ArrayView<const GlobalOrdinal>
getLocalElementList()
const {
return Teuchos::ArrayView<const GlobalOrdinal>(); }
569 Teuchos::RCP<const Teuchos::Comm<int> >
getComm()
const {
return Teuchos::null; }
580 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default)
const {}
583 RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
replaceCommWithSubset(
const Teuchos::RCP<
const Teuchos::Comm<int> > &newComm)
const {
return Teuchos::null; }
591 TpetraMap(
const Teuchos::RCP<
const Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node> > &map) {
599 RCP<const Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node> >
getTpetra_Map()
const {
return Teuchos::null; }
601 #ifdef HAVE_XPETRA_TPETRA
614 #endif // HAVE_XPETRA_EPETRA
620 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
627 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
633 #endif // XPETRA_TPETRAMAP_DEF_HPP
typename Map< LocalOrdinal, GlobalOrdinal, Node >::local_map_type local_map_type
std::string description() const
Return a simple one-line description of this object.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > removeEmptyProcesses() const
Return a new Map with processes with zero elements removed.
LocalOrdinal getMaxLocalIndex() const
The maximum local index on the calling process.
bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is compatible with this Map.
TpetraMap(global_size_t numGlobalElements, size_t numLocalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Constructor with a user-defined contiguous distribution.
UnderlyingLib lib() const
Get the library used by this object (Tpetra or Epetra?)
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Get this Map's Comm object.
GlobalOrdinal getGlobalElement(LocalOrdinal localIndex) const
The global index corresponding to the given local index.
Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >::local_map_type local_map_type
UnderlyingLib lib() const
Get the library used by this object (Tpetra or Epetra?)
GlobalOrdinal getMaxAllGlobalIndex() const
The maximum global index over all processes in the communicator.
LocalOrdinal getMinLocalIndex() const
The minimum local index.
global_size_t getGlobalNumElements() const
The number of elements in this Map.
bool isDistributed() const
Whether this Map is globally distributed or locally replicated.
bool isDistributed() const
Whether this Map is globally distributed or locally replicated.
bool isContiguous() const
True if this Map is distributed contiguously, else false.
GlobalOrdinal getMaxAllGlobalIndex() const
The maximum global index over all processes in the communicator.
TpetraMap(const Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > &map)
TpetraMap constructor to wrap a Tpetra::Map object.
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Get this Map's Comm object.
bool isNodeLocalElement(LocalOrdinal localIndex) const
True if the local index is valid for this Map on this node, else false.
bool isNodeLocalElement(LocalOrdinal localIndex) const
True if the local index is valid for this Map on this node, else false.
GlobalOrdinal getMaxAllGlobalIndex() const
The maximum global index over all processes in the communicator.
LookupStatus getRemoteIndexList(const Teuchos::ArrayView< const GlobalOrdinal > &GIDList, const Teuchos::ArrayView< int > &nodeIDList) const
Return the process IDs for the given global IDs.
bool isNodeLocalElement(LocalOrdinal localIndex) const
True if the local index is valid for this Map on this node, else false.
local_map_type getLocalMap() const
Get the local Map for Kokkos kernels.
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 FancyOStream.
LookupStatus getRemoteIndexList(const Teuchos::ArrayView< const GlobalOrdinal > &GIDList, const Teuchos::ArrayView< int > &nodeIDList, const Teuchos::ArrayView< LocalOrdinal > &LIDList) const
Return the process IDs and corresponding local IDs for the given global IDs.
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 FancyOStream.
bool isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is identical to this Map.
size_t getLocalNumElements() const
The number of elements belonging to the calling node.
#define XPETRA_TPETRA_ETI_EXCEPTION(cl, obj, go, node)
LocalOrdinal getMinLocalIndex() const
The minimum local index.
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 FancyOStream.
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.
GlobalOrdinal getMaxGlobalIndex() const
The maximum global index owned by the calling process.
global_indices_array_device_type getMyGlobalIndicesDevice() const
Return a view of the global indices owned by this process.
Teuchos::ArrayView< const GlobalOrdinal > getLocalElementList() const
Return a view of the global indices owned by this node.
GlobalOrdinal getMinGlobalIndex() const
The minimum global index owned by the calling process.
GlobalOrdinal getIndexBase() const
The index base for this Map.
global_size_t getGlobalNumElements() const
The number of elements in this Map.
GlobalOrdinal getMaxGlobalIndex() const
The maximum global index owned by the calling process.
size_t getLocalNumElements() const
The number of elements belonging to the calling node.
LookupStatus getRemoteIndexList(const Teuchos::ArrayView< const GlobalOrdinal > &GIDList, const Teuchos::ArrayView< int > &nodeIDList) const
Return the process IDs for the given global IDs.
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.
Teuchos::ArrayView< const GlobalOrdinal > getLocalElementList() const
Return a view of the global indices owned by this node.
bool isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is identical to this Map.
RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getTpetra_Map() const
Get the underlying Tpetra map.
TpetraMap(global_size_t numGlobalElements, size_t numLocalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Constructor with a user-defined contiguous distribution.
local_map_type getLocalMap() const
Get the local Map for Kokkos kernels.
GlobalOrdinal getMinAllGlobalIndex() const
The minimum global index over all processes in the communicator.
RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > toTpetra(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph)
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Get this Map's Comm object.
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.
bool isNodeGlobalElement(GlobalOrdinal globalIndex) const
True if the global index is found in this Map on this node, else false.
bool operator!=(const Xpetra::TpetraMap< LocalOrdinal, GlobalOrdinal, Node > &map1, const Xpetra::TpetraMap< LocalOrdinal, GlobalOrdinal, Node > &map2)
Returns true if map is not identical to this map. Implemented in TpetraMap::isSameAs().
bool isContiguous() const
True if this Map is distributed contiguously, else false.
LocalOrdinal getMinLocalIndex() const
The minimum local index.
GlobalOrdinal getMinAllGlobalIndex() const
The minimum global index over all processes in the communicator.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > removeEmptyProcesses() const
Return a new Map with processes with zero elements removed.
RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getTpetra_Map() const
Get the underlying Tpetra map.
size_t global_size_t
Global size_t object.
Teuchos::ArrayView< const GlobalOrdinal > getLocalElementList() const
Return a view of the global indices owned by this node.
GlobalOrdinal getMinGlobalIndex() const
The minimum global index owned by the calling process.
GlobalOrdinal getIndexBase() const
The index base for this Map.
GlobalOrdinal getIndexBase() const
The index base for this Map.
RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getTpetra_Map() const
Get the underlying Tpetra map.
Kokkos::View< const global_ordinal_type *, typename Node::device_type > global_indices_array_device_type
bool isNodeGlobalElement(GlobalOrdinal globalIndex) const
True if the global index is found in this Map on this node, else false.
LocalOrdinal getMaxLocalIndex() const
The maximum local index on the calling 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.
std::string description() const
Return a simple one-line description of this object.
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.
typename Map< LocalOrdinal, GlobalOrdinal, Node >::local_map_type local_map_type
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)
Tpetra::KokkosCompat::KokkosSerialWrapperNode EpetraNode
GlobalOrdinal getMaxGlobalIndex() const
The maximum global index owned by the calling process.
typename Map< LocalOrdinal, GlobalOrdinal, Node >::local_map_type local_map_type
LocalOrdinal getLocalElement(GlobalOrdinal globalIndex) const
The local index corresponding to the given global index.
UnderlyingLib lib() const
Get the library used by this object (Tpetra or Epetra?)
LocalOrdinal getMaxLocalIndex() const
The maximum local index on the calling process.
GlobalOrdinal getMinGlobalIndex() const
The minimum global index owned by the calling process.
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.
#define XPETRA_MONITOR(funcName)
bool isDistributed() const
Whether this Map is globally distributed or locally replicated.
bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is compatible with this Map.
TpetraMap(const Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > &map)
TpetraMap constructor to wrap a Tpetra::Map object.
size_t getLocalNumElements() const
The number of elements belonging to the calling node.
TpetraMap(global_size_t numGlobalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, LocalGlobal lg=GloballyDistributed)
Constructor with Tpetra-defined contiguous uniform distribution.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > removeEmptyProcesses() const
Return a new Map with processes with zero elements removed.
global_size_t getGlobalNumElements() const
The number of elements in this Map.
bool operator==(const Xpetra::TpetraMap< LocalOrdinal, GlobalOrdinal, Node > &map1, const Xpetra::TpetraMap< LocalOrdinal, GlobalOrdinal, Node > &map2)
Returns true if map is identical to this map. Implemented in TpetraMap::isSameAs().
GlobalOrdinal getMinAllGlobalIndex() const
The minimum global index over all processes in the communicator.
TpetraMap(global_size_t numGlobalElements, const Teuchos::ArrayView< const GlobalOrdinal > &elementList, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Constructor with user-defined arbitrary (possibly noncontiguous) distribution.
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.
local_map_type getLocalMap() const
Get the local Map for Kokkos kernels.
TpetraMap(global_size_t numGlobalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, LocalGlobal lg=GloballyDistributed)
Constructor with Tpetra-defined contiguous uniform distribution.
TpetraMap(global_size_t numGlobalElements, const Teuchos::ArrayView< const GlobalOrdinal > &elementList, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Constructor with user-defined arbitrary (possibly noncontiguous) distribution.
std::string description() const
Return a simple one-line description of this object.
LookupStatus getRemoteIndexList(const Teuchos::ArrayView< const GlobalOrdinal > &GIDList, const Teuchos::ArrayView< int > &nodeIDList, const Teuchos::ArrayView< LocalOrdinal > &LIDList) const
Return the process IDs and corresponding local IDs for the given global IDs.
TpetraMap(global_size_t numGlobalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, LocalGlobal lg=GloballyDistributed)
Constructor with Tpetra-defined contiguous uniform distribution.
LookupStatus getRemoteIndexList(const Teuchos::ArrayView< const GlobalOrdinal > &GIDList, const Teuchos::ArrayView< int > &nodeIDList, const Teuchos::ArrayView< LocalOrdinal > &LIDList) const
Return the process IDs and corresponding local IDs for the given global IDs.