10#ifndef XPETRA_EPETRAMAP_HPP
11#define XPETRA_EPETRAMAP_HPP
15#include "Xpetra_Map.hpp"
17#include <Epetra_Map.h>
18#include <Epetra_BlockMap.h>
26#if defined(XPETRA_ENABLE_DEPRECATED_CODE)
28#if defined(Xpetra_SHOW_DEPRECATED_WARNINGS)
29#warning "The header file Trilinos/packages/xpetra/src/Map/Xpetra_EpetraMap.hpp is deprecated."
33#error "The header file Trilinos/packages/xpetra/src/Map/Xpetra_EpetraMap.hpp is deprecated."
39template <
class GlobalOrdinal,
class Node>
42template <
class GlobalOrdinal,
class Node>
43XPETRA_DEPRECATED
const Epetra_Map &
toEpetra(
const RCP<
const Map<int, GlobalOrdinal, Node> > &);
48template <
class GlobalOrdinal,
class Node>
52template <
class GlobalOrdinal,
class Node>
54 :
public virtual Map<int, GlobalOrdinal, Node> {
68 GlobalOrdinal indexBase,
72 "Xpetra::EpetraMap only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
78 "Xpetra::EpetraMap only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
84 GlobalOrdinal indexBase,
87 "Xpetra::EpetraMap only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
205 "Xpetra::EpetraMap only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
216#ifdef HAVE_XPETRA_TPETRA
220 throw std::runtime_error(
"Xpetra::EpetraMap::getLocalMap is not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
224#warning "Xpetra Kokkos interface for CrsMatrix is enabled (HAVE_XPETRA_KOKKOS_REFACTOR) but Tpetra is disabled. The Kokkos interface needs Tpetra to be enabled, too."
235#ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
238 :
public virtual Map<int, int, EpetraNode> {
259 std::string errPrefix;
260 errPrefix =
Teuchos::typeName(*
this) +
"::constructor(numGlobal,indexBase,comm,lOrG): ";
263 const int myImageID = comm->getRank();
268 Teuchos::broadcast<int, global_size_t>(*comm, 0, &rootNGE);
269 Teuchos::broadcast<int, GlobalOrdinal>(*comm, 0, &rootIB);
270 int localChecks[2], globalChecks[2];
273 if (numGlobalElements != rootNGE) {
274 localChecks[0] = myImageID;
276 }
else if (indexBase != rootIB) {
277 localChecks[0] = myImageID;
282 Teuchos::reduceAll<int, int>(*comm, Teuchos::REDUCE_MAX, 2, localChecks, globalChecks);
283 if (globalChecks[0] != -1) {
284 if (globalChecks[1] == 1) {
286 errPrefix <<
"numGlobal must be the same on all nodes (examine node " << globalChecks[0] <<
").");
287 }
else if (globalChecks[1] == 2) {
289 errPrefix <<
"indexBase must be the same on all nodes (examine node " << globalChecks[0] <<
").");
293 errPrefix <<
"logic error. Please contact the Tpetra team.");
306 using Teuchos::outArg;
314 std::string errPrefix;
315 errPrefix =
Teuchos::typeName(*
this) +
"::constructor(numGlobal,numLocal,indexBase,platform): ";
318 const int myImageID = comm->getRank();
323 int localChecks[2], globalChecks[2];
331 Teuchos::reduceAll<int, global_size_t>(*comm, Teuchos::REDUCE_SUM,
332 Teuchos::as<global_size_t>(numLocalElements), outArg(global_sum));
339 if (numLocalElements < L1 && numLocalElements != L0) {
341 localChecks[0] = myImageID;
343 }
else if (numGlobalElements < GST1 && numGlobalElements != GST0 && numGlobalElements != GSTI) {
345 localChecks[0] = myImageID;
347 }
else if (numGlobalElements != GSTI && numGlobalElements != global_sum) {
349 localChecks[0] = myImageID;
354 Teuchos::broadcast<int, GlobalOrdinal>(*comm, 0, &rootIB);
355 if (indexBase != rootIB) {
356 localChecks[0] = myImageID;
361 Teuchos::reduceAll<int, int>(*comm, Teuchos::REDUCE_MAX, 2, localChecks, globalChecks);
362 if (globalChecks[0] != -1) {
363 if (globalChecks[1] == 1) {
365 errPrefix <<
"numLocal is not valid on at least one node (possibly node "
366 << globalChecks[0] <<
").");
367 }
else if (globalChecks[1] == 2) {
369 errPrefix <<
"numGlobal is not valid on at least one node (possibly node "
370 << globalChecks[0] <<
").");
371 }
else if (globalChecks[1] == 3) {
373 errPrefix <<
"numGlobal doesn't match sum of numLocal (== "
374 << global_sum <<
") on at least one node (possibly node "
375 << globalChecks[0] <<
").");
376 }
else if (globalChecks[1] == 4) {
378 errPrefix <<
"indexBase is not the same on all nodes (examine node "
379 << globalChecks[0] <<
").");
383 errPrefix <<
"logic error. Please contact the Tpetra team.");
389 if (numGlobalElements == GSTI) {
390 numGlobalElements = global_sum;
416 return map_->NumGlobalElements64();
422 return map_->NumMyElements();
434 return map_->MinLID();
440 return map_->MaxLID();
470 return map_->LID(globalIndex);
498 if (view.
size() == 0)
501 return Kokkos::View<const global_ordinal_type *, typename Node::device_type, Kokkos::MemoryUnmanaged>(view.
data(), view.
size());
512 return map_->MyLID(localIndex);
518 return map_->MyGID(globalIndex);
524 return map_->LinearMap();
530 return map_->DistributedGlobal();
536 return map_->PointSameAs(toEpetra<GlobalOrdinal, Node>(map));
542 return map_->SameAs(toEpetra<GlobalOrdinal, Node>(map));
566 std::ostringstream oss;
594 int myImageID = comm_->getRank();
595 int numImages = comm_->getSize();
598 if (vl == VERB_DEFAULT) vl = VERB_LOW;
604 width = ::std::max<size_t>(width, (
size_t)12) + 2;
608 if (vl == VERB_NONE) {
610 }
else if (vl == VERB_LOW) {
613 for (
int imageCtr = 0; imageCtr < numImages; ++imageCtr) {
614 if (myImageID == imageCtr) {
615 if (myImageID == 0) {
623 if (vl == VERB_HIGH || vl == VERB_EXTREME) {
624 out <<
"Number of Local Elements = " << nME << endl
629 if (vl == VERB_EXTREME) {
630 out << std::setw(width) <<
"Node ID"
631 << std::setw(width) <<
"Local Index"
632 << std::setw(width) <<
"Global Index"
634 for (
size_t i = 0; i < nME; i++) {
635 out << std::setw(width) << myImageID
636 << std::setw(width) << i
637 << std::setw(width) << myEntries[i]
660 return Teuchos::null;
670 throw std::runtime_error(
"Xpetra::EpetraMapT::replaceCommWithSubset has not yet been implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
681 if (gid ==
map_->IndexBase64() - 1)
709#ifdef HAVE_XPETRA_TPETRA
713 throw std::runtime_error(
"Xpetra::EpetraMap::getLocalMap is not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
720#warning "Xpetra Kokkos interface for CrsMatrix is enabled (HAVE_XPETRA_KOKKOS_REFACTOR) but Tpetra is disabled. The Kokkos interface needs Tpetra to be enabled, too."
730#ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
733 :
public virtual Map<int, long long, EpetraNode> {
754 std::string errPrefix;
755 errPrefix =
Teuchos::typeName(*
this) +
"::constructor(numGlobal,indexBase,comm,lOrG): ";
758 const int myImageID = comm->getRank();
763 Teuchos::broadcast<int, global_size_t>(*comm, 0, &rootNGE);
764 Teuchos::broadcast<int, GlobalOrdinal>(*comm, 0, &rootIB);
765 int localChecks[2], globalChecks[2];
768 if (numGlobalElements != rootNGE) {
769 localChecks[0] = myImageID;
771 }
else if (indexBase != rootIB) {
772 localChecks[0] = myImageID;
777 Teuchos::reduceAll<int, int>(*comm, Teuchos::REDUCE_MAX, 2, localChecks, globalChecks);
778 if (globalChecks[0] != -1) {
779 if (globalChecks[1] == 1) {
781 errPrefix <<
"numGlobal must be the same on all nodes (examine node " << globalChecks[0] <<
").");
782 }
else if (globalChecks[1] == 2) {
784 errPrefix <<
"indexBase must be the same on all nodes (examine node " << globalChecks[0] <<
").");
788 errPrefix <<
"logic error. Please contact the Tpetra team.");
801 using Teuchos::outArg;
809 std::string errPrefix;
810 errPrefix =
Teuchos::typeName(*
this) +
"::constructor(numGlobal,numLocal,indexBase,platform): ";
813 const int myImageID = comm->getRank();
818 int localChecks[2], globalChecks[2];
826 Teuchos::reduceAll<int, global_size_t>(*comm, Teuchos::REDUCE_SUM,
827 Teuchos::as<global_size_t>(numLocalElements), outArg(global_sum));
834 if (numLocalElements < L1 && numLocalElements != L0) {
836 localChecks[0] = myImageID;
838 }
else if (numGlobalElements < GST1 && numGlobalElements != GST0 && numGlobalElements != GSTI) {
840 localChecks[0] = myImageID;
842 }
else if (numGlobalElements != GSTI && numGlobalElements != global_sum) {
844 localChecks[0] = myImageID;
849 Teuchos::broadcast<int, GlobalOrdinal>(*comm, 0, &rootIB);
850 if (indexBase != rootIB) {
851 localChecks[0] = myImageID;
856 Teuchos::reduceAll<int, int>(*comm, Teuchos::REDUCE_MAX, 2, localChecks, globalChecks);
857 if (globalChecks[0] != -1) {
858 if (globalChecks[1] == 1) {
860 errPrefix <<
"numLocal is not valid on at least one node (possibly node "
861 << globalChecks[0] <<
").");
862 }
else if (globalChecks[1] == 2) {
864 errPrefix <<
"numGlobal is not valid on at least one node (possibly node "
865 << globalChecks[0] <<
").");
866 }
else if (globalChecks[1] == 3) {
868 errPrefix <<
"numGlobal doesn't match sum of numLocal (== "
869 << global_sum <<
") on at least one node (possibly node "
870 << globalChecks[0] <<
").");
871 }
else if (globalChecks[1] == 4) {
873 errPrefix <<
"indexBase is not the same on all nodes (examine node "
874 << globalChecks[0] <<
").");
878 errPrefix <<
"logic error. Please contact the Tpetra team.");
884 if (numGlobalElements == GSTI) {
885 numGlobalElements = global_sum;
911 return map_->NumGlobalElements64();
917 return map_->NumMyElements();
929 return map_->MinLID();
935 return map_->MaxLID();
965 return map_->LID(globalIndex);
990 if (view.
size() == 0)
993 return Kokkos::View<const global_ordinal_type *, typename Node::device_type, Kokkos::MemoryUnmanaged>(view.
data(), view.
size());
1004 return map_->MyLID(localIndex);
1010 return map_->MyGID(globalIndex);
1016 return map_->LinearMap();
1022 return map_->DistributedGlobal();
1028 return map_->PointSameAs(toEpetra<GlobalOrdinal, Node>(map));
1034 return map_->SameAs(toEpetra<GlobalOrdinal, Node>(map));
1058 std::ostringstream oss;
1086 int myImageID = comm_->getRank();
1087 int numImages = comm_->getSize();
1090 if (vl == VERB_DEFAULT) vl = VERB_LOW;
1096 width = ::std::max<size_t>(width, (
size_t)12) + 2;
1100 if (vl == VERB_NONE) {
1102 }
else if (vl == VERB_LOW) {
1105 for (
int imageCtr = 0; imageCtr < numImages; ++imageCtr) {
1106 if (myImageID == imageCtr) {
1107 if (myImageID == 0) {
1115 if (vl == VERB_HIGH || vl == VERB_EXTREME) {
1116 out <<
"Number of Local Elements = " << nME << endl
1121 if (vl == VERB_EXTREME) {
1122 out << std::setw(width) <<
"Node ID"
1123 << std::setw(width) <<
"Local Index"
1124 << std::setw(width) <<
"Global Index"
1126 for (
size_t i = 0; i < nME; i++) {
1127 out << std::setw(width) << myImageID
1128 << std::setw(width) << i
1129 << std::setw(width) << myEntries[i]
1152 return Teuchos::null;
1162 throw std::runtime_error(
"Xpetra::EpetraMapT::replaceCommWithSubset has not yet been implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
1173 if (gid ==
map_->IndexBase64() - 1)
1199#ifdef HAVE_XPETRA_TPETRA
1203 throw std::runtime_error(
"Xpetra::EpetraMap::getLocalMap is not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
1210#warning "Xpetra Kokkos interface for CrsMatrix is enabled (HAVE_XPETRA_KOKKOS_REFACTOR) but Tpetra is disabled. The Kokkos interface needs Tpetra to be enabled, too."
#define XPETRA_MONITOR(funcName)
#define IF_EPETRA_EXCEPTION_THEN_THROW_GLOBAL_INVALID_ARG(sourceCode)
static const EVerbosityLevel verbLevel_default
virtual std::string description() const
bool isNodeLocalElement(LocalOrdinal localIndex) const
Whether the given local index is valid for this Map on this process.
GlobalOrdinal getMaxAllGlobalIndex() const
The maximum global index over all processes in the communicator.
local_map_type getLocalMap() const
Get the local Map for Kokkos kernels.
size_t getLocalNumElements() const
The number of elements belonging to the calling process.
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.
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.
GlobalOrdinal global_ordinal_type
GlobalOrdinal getIndexBase() const
The index base for this Map.
const Epetra_Map & getEpetra_Map() const
const Epetra_BlockMap & getEpetra_BlockMap() const
GlobalOrdinal getMinAllGlobalIndex() const
The minimum global index over all processes in the communicator.
UnderlyingLib lib() const
Get the library used by this object (Epetra or Epetra?)
bool isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is identical to this Map.
LocalOrdinal getMinLocalIndex() const
The minimum local index.
EpetraMapT(global_size_t numGlobalElements, size_t numLocalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Constructor with a user-defined contiguous distribution.
GlobalOrdinal getGlobalElement(LocalOrdinal localIndex) const
Return the global index for a given local index. Note that this returns -1 if not found on this proce...
LocalOrdinal getLocalElement(GlobalOrdinal globalIndex) const
The local index corresponding to the given global index.
GlobalOrdinal getMaxGlobalIndex() const
The maximum global index owned by the calling process.
LocalOrdinal local_ordinal_type
RCP< const Epetra_BlockMap > map_
EpetraMapT(const Teuchos::RCP< const Epetra_BlockMap > &map)
EpetraMapT constructor to wrap a Epetra_Map object.
EpetraMapT(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.
GlobalOrdinal getMinGlobalIndex() const
The minimum global index owned by the calling process.
EpetraMapT(global_size_t numGlobalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, LocalGlobal lg=GloballyDistributed)
Constructor with Tpetra-defined contiguous uniform distribution.
Map< LocalOrdinal, GlobalOrdinal, Node >::global_indices_array_device_type global_indices_array_device_type
RCP< const Map< int, GlobalOrdinal, Node > > replaceCommWithSubset(const Teuchos::RCP< const Teuchos::Comm< int > > &) const
Replace this Map's communicator with a subset communicator.
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Get this Map's Comm object.
Teuchos::ArrayView< const GlobalOrdinal > getLocalElementList() const
Return a view of the global indices owned by this process.
LocalOrdinal getMaxLocalIndex() const
The maximum local index on the calling process.
std::string description() const
Return a simple one-line description of this object.
const RCP< const Epetra_Map > getEpetra_MapRCP() const
Get the underlying Epetra map.
bool isNodeGlobalElement(GlobalOrdinal globalIndex) const
Whether the given global index is valid for this Map on this process.
global_size_t getGlobalNumElements() const
The number of elements in this Map.
LookupStatus getRemoteIndexList(const Teuchos::ArrayView< const GlobalOrdinal > &GIDList, const Teuchos::ArrayView< int > &nodeIDList) const
Return the process ranks for the given global indices.
bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is compatible with this Map.
typename Map< LocalOrdinal, GlobalOrdinal, Node >::local_map_type local_map_type
RCP< const Map< int, GlobalOrdinal, Node > > removeEmptyProcesses() const
Return a new Map with processes with zero elements removed.
global_indices_array_device_type getMyGlobalIndicesDevice() const
Return a view of the global indices owned by this process.
bool isContiguous() const
True if this Map is distributed contiguously, else false.
bool isDistributed() const
Whether this Map is globally distributed or locally replicated.
virtual ~EpetraMapT()
Destructor.
size_t getLocalNumElements() const
The number of elements belonging to the calling process.
GlobalOrdinal getMaxGlobalIndex() const
The maximum global index owned by the calling process.
GlobalOrdinal getIndexBase() const
The index base for this Map.
RCP< const Map< int, GlobalOrdinal, Node > > removeEmptyProcesses() const
Return a new Map with processes with zero elements removed.
EpetraMapT(global_size_t numGlobalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, LocalGlobal lg=GloballyDistributed)
Constructor with Tpetra-defined contiguous uniform distribution.
EpetraMapT(const Teuchos::RCP< const Epetra_BlockMap > &map)
EpetraMapT constructor to wrap a Epetra_Map object.
bool isNodeLocalElement(LocalOrdinal localIndex) const
Whether the given local index is valid for this Map on this process.
EpetraMapT(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.
LocalOrdinal local_ordinal_type
LookupStatus getRemoteIndexList(const Teuchos::ArrayView< const GlobalOrdinal > &GIDList, const Teuchos::ArrayView< int > &nodeIDList) const
Return the process ranks for the given global indices.
RCP< const Epetra_BlockMap > map_
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.
global_indices_array_device_type getMyGlobalIndicesDevice() const
Return a view of the global indices owned by this process.
const Epetra_BlockMap & getEpetra_BlockMap() const
global_size_t getGlobalNumElements() const
The number of elements in this Map.
bool isNodeGlobalElement(GlobalOrdinal globalIndex) const
Whether the given global index is valid for this Map on this process.
const RCP< const Epetra_Map > & getEpetra_MapRCP() const
Get the underlying Epetra map.
local_map_type getLocalMap() const
Get the local Map for Kokkos kernels.
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.
GlobalOrdinal getMinGlobalIndex() const
The minimum global index owned by the calling process.
LocalOrdinal getMaxLocalIndex() const
The maximum local index on the calling process.
Map< LocalOrdinal, GlobalOrdinal, Node >::global_indices_array_type global_indices_array_type
const Epetra_Map & getEpetra_Map() const
Teuchos::ArrayView< const GlobalOrdinal > getLocalElementList() const
Return a view of the global indices owned by this process.
UnderlyingLib lib() const
Get the library used by this object (Epetra or Epetra?)
RCP< const Map< int, GlobalOrdinal, Node > > replaceCommWithSubset(const Teuchos::RCP< const Teuchos::Comm< int > > &) const
Replace this Map's communicator with a subset communicator.
virtual ~EpetraMapT()
Destructor.
LocalOrdinal getLocalElement(GlobalOrdinal globalIndex) const
The local index corresponding to the given global index.
bool isContiguous() const
True if this Map is distributed contiguously, else false.
GlobalOrdinal global_ordinal_type
std::string description() const
Return a simple one-line description of this object.
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Get this Map's Comm object.
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.
EpetraMapT(global_size_t numGlobalElements, size_t numLocalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Constructor with a user-defined contiguous distribution.
GlobalOrdinal getMaxAllGlobalIndex() const
The maximum global index over all processes in the communicator.
GlobalOrdinal getMinAllGlobalIndex() const
The minimum global index over all processes in the communicator.
bool isDistributed() const
Whether this Map is globally distributed or locally replicated.
GlobalOrdinal getGlobalElement(LocalOrdinal localIndex) const
Return the global index for a given local index. Note that this returns -1 if not found on this proce...
LocalOrdinal getMinLocalIndex() const
The minimum local index.
typename Map< LocalOrdinal, GlobalOrdinal, Node >::local_map_type local_map_type
EpetraMapT(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.
bool isContiguous() const
True if this Map is distributed contiguously, else false.
global_indices_array_device_type getMyGlobalIndicesDevice() const
Return a view of the global indices owned by this process.
LocalOrdinal getLocalElement(GlobalOrdinal) const
The local index corresponding to the given global index.
EpetraMapT(global_size_t numGlobalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, LocalGlobal lg=GloballyDistributed)
Constructor with Tpetra-defined contiguous uniform distribution.
bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &) const
True if and only if map is compatible with this Map.
const Epetra_BlockMap & getEpetra_BlockMap() const
bool isNodeGlobalElement(GlobalOrdinal) const
Whether the given global index is valid for this Map on this process.
virtual ~EpetraMapT()
Destructor.
UnderlyingLib lib() const
Get the library used by this object (Epetra or Epetra?)
RCP< const Map< int, GlobalOrdinal, Node > > removeEmptyProcesses() const
Return a new Map with processes with zero elements removed.
LookupStatus getRemoteIndexList(const Teuchos::ArrayView< const GlobalOrdinal > &, const Teuchos::ArrayView< int > &, const Teuchos::ArrayView< LocalOrdinal > &) const
Return the process ranks and corresponding local indices for the given global indices.
LocalOrdinal getMinLocalIndex() const
The minimum local index.
size_t getLocalNumElements() const
The number of elements belonging to the calling process.
LookupStatus getRemoteIndexList(const Teuchos::ArrayView< const GlobalOrdinal > &, const Teuchos::ArrayView< int > &) const
Return the process ranks for the given global indices.
bool isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &) const
True if and only if map is identical to this Map.
std::string description() const
Return a simple one-line description of this object.
RCP< const Epetra_BlockMap > map_
bool isNodeLocalElement(LocalOrdinal) const
Whether the given local index is valid for this Map on this process.
local_map_type getLocalMap() const
Get the local Map for Kokkos kernels.
GlobalOrdinal getMaxGlobalIndex() const
The maximum global index owned by the calling process.
const Epetra_Map & getEpetra_Map() const
EpetraMapT(const Teuchos::RCP< const Epetra_BlockMap > &map)
EpetraMapT constructor to wrap a Epetra_Map object.
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Get this Map's Comm object.
GlobalOrdinal getMinGlobalIndex() const
The minimum global index owned by the calling process.
Teuchos::ArrayView< const GlobalOrdinal > getLocalElementList() const
Return a view of the global indices owned by this process.
GlobalOrdinal getMaxAllGlobalIndex() const
The maximum global index over all processes in the communicator.
GlobalOrdinal getGlobalElement(LocalOrdinal) const
Return the global index for a given local index. Note that this returns -1 if not found on this proce...
EpetraMapT(global_size_t numGlobalElements, size_t numLocalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Constructor with a user-defined contiguous distribution.
bool isDistributed() const
Whether this Map is globally distributed or locally replicated.
const RCP< const Epetra_Map > & getEpetra_MapRCP() const
Get the underlying Epetra map.
Map< LocalOrdinal, GlobalOrdinal, Node >::global_indices_array_device_type global_indices_array_device_type
global_size_t getGlobalNumElements() const
The number of elements in this Map.
LocalOrdinal getMaxLocalIndex() const
The maximum local index on the calling process.
GlobalOrdinal getIndexBase() const
The index base for this Map.
RCP< const Map< int, GlobalOrdinal, Node > > replaceCommWithSubset(const Teuchos::RCP< const Teuchos::Comm< int > > &) const
Replace this Map's communicator with a subset communicator.
GlobalOrdinal getMinAllGlobalIndex() const
The minimum global index over all processes in the communicator.
typename Map< LocalOrdinal, GlobalOrdinal, Node >::local_map_type local_map_type
void describe(Teuchos::FancyOStream &, const Teuchos::EVerbosityLevel=Teuchos::Describable::verbLevel_default) const
Print this object with the given verbosity level to the given Teuchos::FancyOStream.
GlobalOrdinal global_ordinal_type
Exception throws to report errors in the internal logical of the program.
Kokkos::View< const global_ordinal_type *, typename Node::device_type > global_indices_array_device_type
Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >::local_map_type local_map_type
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
#define TEUCHOS_UNREACHABLE_RETURN(dummyReturnVal)
std::string typeName(const T &t)
Tpetra::KokkosCompat::KokkosSerialWrapperNode EpetraNode
size_t global_size_t
Global size_t object.
const Epetra_CrsGraph & toEpetra(const RCP< const CrsGraph< int, GlobalOrdinal, Node > > &graph)
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)