10 #ifndef XPETRA_TPETRAMAP_DEF_HPP
11 #define XPETRA_TPETRAMAP_DEF_HPP
20 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
23 GlobalOrdinal indexBase,
24 const Teuchos::RCP<
const Teuchos::Comm<int> > &comm,
26 : map_(Teuchos::rcp(new Tpetra::
Map<LocalOrdinal, GlobalOrdinal, Node>(numGlobalElements,
32 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
35 size_t numLocalElements,
36 GlobalOrdinal indexBase,
37 const Teuchos::RCP<
const Teuchos::Comm<int> > &comm)
38 : map_(Teuchos::rcp(new Tpetra::
Map<LocalOrdinal, GlobalOrdinal, Node>(numGlobalElements,
44 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
47 const Teuchos::ArrayView<const GlobalOrdinal> &elementList,
48 GlobalOrdinal indexBase,
49 const Teuchos::RCP<
const Teuchos::Comm<int> > &comm)
50 : map_(Teuchos::rcp(new Tpetra::
Map<LocalOrdinal, GlobalOrdinal, Node>(numGlobalElements,
55 #ifdef HAVE_XPETRA_TPETRA
58 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
61 const Kokkos::View<const GlobalOrdinal *, typename Node::device_type> &indexList,
62 GlobalOrdinal indexBase,
63 const Teuchos::RCP<
const Teuchos::Comm<int> > &comm)
64 : map_(Teuchos::rcp(new Tpetra::
Map<LocalOrdinal, GlobalOrdinal, Node>(numGlobalElements,
71 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
76 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
79 return map_->getGlobalNumElements();
82 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
85 return map_->getLocalNumElements();
88 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
91 return map_->getIndexBase();
94 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
97 return map_->getMinLocalIndex();
100 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
103 return map_->getMaxLocalIndex();
106 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
109 return map_->getMinGlobalIndex();
112 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
115 return map_->getMaxGlobalIndex();
118 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
121 return map_->getMinAllGlobalIndex();
124 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
127 return map_->getMaxAllGlobalIndex();
130 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
133 return map_->getLocalElement(globalIndex);
136 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
139 return map_->getGlobalElement(localIndex);
142 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
145 return toXpetra(map_->getRemoteIndexList(GIDList, nodeIDList, LIDList));
148 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
151 return toXpetra(map_->getRemoteIndexList(GIDList, nodeIDList));
154 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
157 return map_->getLocalElementList();
160 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
163 return map_->getMyGlobalIndicesDevice();
166 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
169 return map_->isNodeLocalElement(localIndex);
172 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
175 return map_->isNodeGlobalElement(globalIndex);
178 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
181 return map_->isContiguous();
184 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
187 return map_->isDistributed();
190 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
193 return map_->isCompatible(
toTpetra(map));
196 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
199 return map_->isSameAs(
toTpetra(map));
202 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
205 return map_->getComm();
208 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
211 return map_->description();
214 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
217 map_->describe(out, verbLevel);
220 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
222 return toXpetra(map_->removeEmptyProcesses());
225 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
227 return toXpetra(map_->replaceCommWithSubset(newComm));
230 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
234 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
237 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
240 #ifdef HAVE_XPETRA_TPETRA
242 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
244 return map_->getLocalMap();
248 #ifdef HAVE_XPETRA_EPETRA
250 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \
251 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT))))
256 :
public virtual Map<int, int, EpetraNode> {
269 const Teuchos::RCP<
const Teuchos::Comm<int> > &comm,
277 size_t numLocalElements,
279 const Teuchos::RCP<
const Teuchos::Comm<int> > &comm) {
286 const Teuchos::ArrayView<const GlobalOrdinal> &elementList,
288 const Teuchos::RCP<
const Teuchos::Comm<int> > &comm) {
340 Teuchos::ArrayView<const GlobalOrdinal>
getLocalElementList()
const {
return Teuchos::ArrayView<const GlobalOrdinal>(); }
371 Teuchos::RCP<const Teuchos::Comm<int> >
getComm()
const {
return Teuchos::null; }
382 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default)
const {}
385 RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
replaceCommWithSubset(
const Teuchos::RCP<
const Teuchos::Comm<int> > &newComm)
const {
return Teuchos::null; }
393 TpetraMap(
const Teuchos::RCP<
const Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node> > &map) {
401 RCP<const Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node> >
getTpetra_Map()
const {
return Teuchos::null; }
403 #ifdef HAVE_XPETRA_TPETRA
416 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
417 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
421 :
public virtual Map<int, long long, EpetraNode> {
433 const Teuchos::RCP<
const Teuchos::Comm<int> > &comm,
440 size_t numLocalElements,
442 const Teuchos::RCP<
const Teuchos::Comm<int> > &comm) {
448 const Teuchos::ArrayView<const GlobalOrdinal> &elementList,
450 const Teuchos::RCP<
const Teuchos::Comm<int> > &comm) {
502 Teuchos::ArrayView<const GlobalOrdinal>
getLocalElementList()
const {
return Teuchos::ArrayView<const GlobalOrdinal>(); }
533 Teuchos::RCP<const Teuchos::Comm<int> >
getComm()
const {
return Teuchos::null; }
544 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default)
const {}
547 RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
replaceCommWithSubset(
const Teuchos::RCP<
const Teuchos::Comm<int> > &newComm)
const {
return Teuchos::null; }
555 TpetraMap(
const Teuchos::RCP<
const Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node> > &map) {
563 RCP<const Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node> >
getTpetra_Map()
const {
return Teuchos::null; }
565 #ifdef HAVE_XPETRA_TPETRA
578 #endif // HAVE_XPETRA_EPETRA
584 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
591 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
597 #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
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.
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)
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.