Go to the documentation of this file.
46 #ifndef XPETRA_EPETRAMAP_HPP
47 #define XPETRA_EPETRAMAP_HPP
54 #include <Epetra_Map.h>
55 #include <Epetra_BlockMap.h>
66 template<
class GlobalOrdinal,
class Node>
68 template<
class GlobalOrdinal,
class Node>
72 template<
class GlobalOrdinal,
class Node>
76 template<
class GlobalOrdinal,
class Node>
78 :
public virtual Map<int, GlobalOrdinal, Node>
92 GlobalOrdinal indexBase,
98 "Xpetra::EpetraMap only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
104 "Xpetra::EpetraMap only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
110 GlobalOrdinal indexBase,
114 "Xpetra::EpetraMap only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
236 "Xpetra::EpetraMap only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
247 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
248 #ifdef HAVE_XPETRA_TPETRA
251 local_map_type getLocalMap ()
const {
253 "Xpetra::EpetraMap only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
258 #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."
271 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
274 :
public virtual Map<int, int, EpetraNode>
297 std::string errPrefix;
298 errPrefix =
Teuchos::typeName(*
this) +
"::constructor(numGlobal,indexBase,comm,lOrG): ";
301 const int myImageID = comm->getRank();
306 Teuchos::broadcast<int,global_size_t>(*comm,0,&rootNGE);
307 Teuchos::broadcast<int,GlobalOrdinal>(*comm,0,&rootIB);
308 int localChecks[2], globalChecks[2];
311 if (numGlobalElements != rootNGE) {
312 localChecks[0] = myImageID;
315 else if (indexBase != rootIB) {
316 localChecks[0] = myImageID;
321 Teuchos::reduceAll<int,int>(*comm,Teuchos::REDUCE_MAX,2,localChecks,globalChecks);
322 if (globalChecks[0] != -1) {
323 if (globalChecks[1] == 1) {
325 errPrefix <<
"numGlobal must be the same on all nodes (examine node " << globalChecks[0] <<
").");
327 else if (globalChecks[1] == 2) {
329 errPrefix <<
"indexBase must be the same on all nodes (examine node " << globalChecks[0] <<
").");
334 errPrefix <<
"logic error. Please contact the Tpetra team.");
348 using Teuchos::outArg;
356 std::string errPrefix;
357 errPrefix =
Teuchos::typeName(*
this) +
"::constructor(numGlobal,numLocal,indexBase,platform): ";
360 const int myImageID = comm->getRank();
365 int localChecks[2], globalChecks[2];
373 Teuchos::reduceAll<int,global_size_t>(*comm,Teuchos::REDUCE_SUM,
374 Teuchos::as<global_size_t>(numLocalElements),outArg(global_sum));
381 if (numLocalElements < L1 && numLocalElements != L0) {
383 localChecks[0] = myImageID;
386 else if (numGlobalElements < GST1 && numGlobalElements != GST0 && numGlobalElements != GSTI) {
388 localChecks[0] = myImageID;
391 else if (numGlobalElements != GSTI && numGlobalElements != global_sum) {
393 localChecks[0] = myImageID;
398 Teuchos::broadcast<int,GlobalOrdinal>(*comm,0,&rootIB);
399 if (indexBase != rootIB) {
400 localChecks[0] = myImageID;
405 Teuchos::reduceAll<int,int>(*comm,Teuchos::REDUCE_MAX,2,localChecks,globalChecks);
406 if (globalChecks[0] != -1) {
407 if (globalChecks[1] == 1) {
409 errPrefix <<
"numLocal is not valid on at least one node (possibly node "
410 << globalChecks[0] <<
").");
412 else if (globalChecks[1] == 2) {
414 errPrefix <<
"numGlobal is not valid on at least one node (possibly node "
415 << globalChecks[0] <<
").");
417 else if (globalChecks[1] == 3) {
419 errPrefix <<
"numGlobal doesn't match sum of numLocal (== "
420 << global_sum <<
") on at least one node (possibly node "
421 << globalChecks[0] <<
").");
423 else if (globalChecks[1] == 4) {
425 errPrefix <<
"indexBase is not the same on all nodes (examine node "
426 << globalChecks[0] <<
").");
431 errPrefix <<
"logic error. Please contact the Tpetra team.");
438 if (numGlobalElements == GSTI) {
439 numGlobalElements = global_sum;}
548 std::ostringstream oss;
576 int myImageID = comm_->getRank();
577 int numImages = comm_->getSize();
586 width = ::std::max<size_t>(width, (
size_t) 12) + 2;
597 for (
int imageCtr = 0; imageCtr < numImages; ++imageCtr) {
598 if (myImageID == imageCtr) {
599 if (myImageID == 0) {
608 out <<
"Number of Local Elements = " << nME << endl
614 out << std::setw(width) <<
"Node ID"
615 << std::setw(width) <<
"Local Index"
616 << std::setw(width) <<
"Global Index"
618 for (
size_t i=0; i < nME; i++) {
619 out << std::setw(width) << myImageID
620 << std::setw(width) << i
621 << std::setw(width) << myEntries[i]
644 return Teuchos::null;
654 throw std::runtime_error(
"Xpetra::EpetraMapT::replaceCommWithSubset has not yet been implemented.");
665 if (gid ==
map_->IndexBase64()-1)
return (-1);
691 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
692 #ifdef HAVE_XPETRA_TPETRA
695 local_map_type getLocalMap ()
const {
696 if (isInitializedLocalMap_)
699 typedef GlobalOrdinal
GO;
702 typedef typename Node::device_type DeviceType;
704 typedef Tpetra::Details::FixedHashTable<GO, LO, DeviceType> glMapType;
705 typedef ::Kokkos::View<GO*, ::Kokkos::LayoutLeft, DeviceType> lgMapType;
714 GO firstContiguousGID, lastContiguousGID;
717 if (numLocalElements) {
720 firstContiguousGID = myMinGID;
721 lastContiguousGID = myMaxGID+1;
727 lgMap = lgMapType(
"lgMap", numLocalElements);
729 firstContiguousGID = GIDs[0];
730 lastContiguousGID = firstContiguousGID+1;
733 lgMap(0) = firstContiguousGID;
734 for ( ; i < numLocalElements; ++i) {
735 const GO curGID = GIDs[i];
736 const LO curLid = Teuchos::as<LO> (i);
738 if (lastContiguousGID != curGID)
745 lgMap(curLid) = curGID;
750 ::Kokkos::View<GO*, ::Kokkos::LayoutLeft, DeviceType>
751 nonContigGIDs (
"nonContigGIDs", numLocalElements-i);
753 for (
size_t idx = 0; idx < numLocalElements - i; idx++)
754 nonContigGIDs(idx) = GIDs[i+idx];
756 glMap = glMapType (nonContigGIDs,
759 static_cast<LO> (i));
761 for ( ; i < numLocalElements; ++i) {
762 const GO curGID = GIDs[i];
763 const LO curLid = Teuchos::as<LO> (i);
765 lgMap(curLid) = curGID;
771 firstContiguousGID = indexBase+1;
772 lastContiguousGID = indexBase;
774 localMap_ = local_map_type(glMap, lgMap, indexBase, myMinGID, myMaxGID, firstContiguousGID, lastContiguousGID, numLocalElements, contiguous);
776 isInitializedLocalMap_ =
true;
782 mutable local_map_type localMap_;
783 mutable bool isInitializedLocalMap_ =
false;
786 #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."
795 #endif // #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
798 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
801 :
public virtual Map<int, long long, EpetraNode>
823 std::string errPrefix;
824 errPrefix =
Teuchos::typeName(*
this) +
"::constructor(numGlobal,indexBase,comm,lOrG): ";
827 const int myImageID = comm->getRank();
832 Teuchos::broadcast<int,global_size_t>(*comm,0,&rootNGE);
833 Teuchos::broadcast<int,GlobalOrdinal>(*comm,0,&rootIB);
834 int localChecks[2], globalChecks[2];
837 if (numGlobalElements != rootNGE) {
838 localChecks[0] = myImageID;
841 else if (indexBase != rootIB) {
842 localChecks[0] = myImageID;
847 Teuchos::reduceAll<int,int>(*comm,Teuchos::REDUCE_MAX,2,localChecks,globalChecks);
848 if (globalChecks[0] != -1) {
849 if (globalChecks[1] == 1) {
851 errPrefix <<
"numGlobal must be the same on all nodes (examine node " << globalChecks[0] <<
").");
853 else if (globalChecks[1] == 2) {
855 errPrefix <<
"indexBase must be the same on all nodes (examine node " << globalChecks[0] <<
").");
860 errPrefix <<
"logic error. Please contact the Tpetra team.");
873 using Teuchos::outArg;
881 std::string errPrefix;
882 errPrefix =
Teuchos::typeName(*
this) +
"::constructor(numGlobal,numLocal,indexBase,platform): ";
885 const int myImageID = comm->getRank();
890 int localChecks[2], globalChecks[2];
898 Teuchos::reduceAll<int,global_size_t>(*comm,Teuchos::REDUCE_SUM,
899 Teuchos::as<global_size_t>(numLocalElements),outArg(global_sum));
906 if (numLocalElements < L1 && numLocalElements != L0) {
908 localChecks[0] = myImageID;
911 else if (numGlobalElements < GST1 && numGlobalElements != GST0 && numGlobalElements != GSTI) {
913 localChecks[0] = myImageID;
916 else if (numGlobalElements != GSTI && numGlobalElements != global_sum) {
918 localChecks[0] = myImageID;
923 Teuchos::broadcast<int,GlobalOrdinal>(*comm,0,&rootIB);
924 if (indexBase != rootIB) {
925 localChecks[0] = myImageID;
930 Teuchos::reduceAll<int,int>(*comm,Teuchos::REDUCE_MAX,2,localChecks,globalChecks);
931 if (globalChecks[0] != -1) {
932 if (globalChecks[1] == 1) {
934 errPrefix <<
"numLocal is not valid on at least one node (possibly node "
935 << globalChecks[0] <<
").");
937 else if (globalChecks[1] == 2) {
939 errPrefix <<
"numGlobal is not valid on at least one node (possibly node "
940 << globalChecks[0] <<
").");
942 else if (globalChecks[1] == 3) {
944 errPrefix <<
"numGlobal doesn't match sum of numLocal (== "
945 << global_sum <<
") on at least one node (possibly node "
946 << globalChecks[0] <<
").");
948 else if (globalChecks[1] == 4) {
950 errPrefix <<
"indexBase is not the same on all nodes (examine node "
951 << globalChecks[0] <<
").");
956 errPrefix <<
"logic error. Please contact the Tpetra team.");
963 if (numGlobalElements == GSTI) {
964 numGlobalElements = global_sum;}
1072 std::ostringstream oss;
1100 int myImageID = comm_->getRank();
1101 int numImages = comm_->getSize();
1110 width = ::std::max<size_t>(width, (
size_t) 12) + 2;
1121 for (
int imageCtr = 0; imageCtr < numImages; ++imageCtr) {
1122 if (myImageID == imageCtr) {
1123 if (myImageID == 0) {
1132 out <<
"Number of Local Elements = " << nME << endl
1138 out << std::setw(width) <<
"Node ID"
1139 << std::setw(width) <<
"Local Index"
1140 << std::setw(width) <<
"Global Index"
1142 for (
size_t i=0; i < nME; i++) {
1143 out << std::setw(width) << myImageID
1144 << std::setw(width) << i
1145 << std::setw(width) << myEntries[i]
1168 return Teuchos::null;
1178 throw std::runtime_error(
"Xpetra::EpetraMapT::replaceCommWithSubset has not yet been implemented.");
1189 if (gid ==
map_->IndexBase64()-1)
return (-1);
1213 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
1214 #ifdef HAVE_XPETRA_TPETRA
1217 local_map_type getLocalMap ()
const {
1218 if (isInitializedLocalMap_)
1221 typedef GlobalOrdinal
GO;
1224 typedef typename Node::device_type DeviceType;
1226 typedef Tpetra::Details::FixedHashTable<GO, LO, DeviceType> glMapType;
1227 typedef ::Kokkos::View<GO*, ::Kokkos::LayoutLeft, DeviceType> lgMapType;
1236 GO firstContiguousGID, lastContiguousGID;
1239 if (numLocalElements) {
1242 firstContiguousGID = myMinGID;
1243 lastContiguousGID = myMaxGID+1;
1249 lgMap = lgMapType(
"lgMap", numLocalElements);
1251 firstContiguousGID = GIDs[0];
1252 lastContiguousGID = firstContiguousGID+1;
1255 lgMap(0) = firstContiguousGID;
1256 for ( ; i < numLocalElements; ++i) {
1257 const GO curGID = GIDs[i];
1258 const LO curLid = Teuchos::as<LO> (i);
1260 if (lastContiguousGID != curGID)
1267 lgMap(curLid) = curGID;
1268 ++lastContiguousGID;
1270 --lastContiguousGID;
1272 ::Kokkos::View<GO*, ::Kokkos::LayoutLeft, DeviceType>
1273 nonContigGIDs (
"nonContigGIDs", numLocalElements-i);
1275 for (
size_t idx = 0; idx < numLocalElements - i; idx++)
1276 nonContigGIDs(idx) = GIDs[i+idx];
1278 glMap = glMapType (nonContigGIDs,
1281 static_cast<LO> (i));
1283 for ( ; i < numLocalElements; ++i) {
1284 const GO curGID = GIDs[i];
1285 const LO curLid = Teuchos::as<LO> (i);
1287 lgMap(curLid) = curGID;
1293 firstContiguousGID = indexBase+1;
1294 lastContiguousGID = indexBase;
1296 localMap_ = local_map_type(glMap, lgMap, indexBase, myMinGID, myMaxGID, firstContiguousGID, lastContiguousGID, numLocalElements, contiguous);
1298 isInitializedLocalMap_ =
true;
1304 mutable local_map_type localMap_;
1305 mutable bool isInitializedLocalMap_ =
false;
1308 #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."
1319 #endif // #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
1323 #endif // XPETRA_EPETRAMAP_HPP
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 local_ordinal_type
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 Epetra_Comm & Comm() const
EpetraMapT(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=Teuchos::rcp(new Node))
Constructor with user-defined arbitrary (possibly noncontiguous) distribution.
int NumMyElements() const
std::string description() const
Return a simple one-line description of this object.
const Epetra_BlockMap & getEpetra_BlockMap() const
Get the underlying Epetra map.
const Epetra_Map & getEpetra_Map() const
LookupStatus getRemoteIndexList(const Teuchos::ArrayView< const GlobalOrdinal > &GIDList, const Teuchos::ArrayView< int > &nodeIDList) const
Return the process ranks for the given global indices.
LocalOrdinal getLocalElement(GlobalOrdinal globalIndex) const
The local index corresponding to the given global index.
size_t global_size_t
Global size_t object.
bool isNodeLocalElement(LocalOrdinal localIndex) const
Whether the given local index is valid for this Map on this process.
LocalOrdinal getLocalElement(GlobalOrdinal globalIndex) const
The local index corresponding to the given global index.
GlobalOrdinal global_ordinal_type
GlobalOrdinal getMaxAllGlobalIndex() const
The maximum global index over all processes in the communicator.
bool isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is identical to this Map.
int RemoteIDList(int NumIDs, const int *GIDList, int *PIDList, int *LIDList) const
bool isNodeLocalElement(LocalOrdinal localIndex) const
Whether the given local index is valid for this Map on this process.
Teuchos::RCP< Node > getNode() const
Get this Map's Node object.
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.
LocalOrdinal getLocalElement(GlobalOrdinal globalIndex) const
The local index corresponding to the given global index.
virtual std::string description() const
EpetraMapT(global_size_t numGlobalElements, size_t numLocalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node=Teuchos::rcp(new Node))
Constructor with a user-defined contiguous distribution.
const Epetra_Map & getEpetra_Map() const
EpetraMapT(global_size_t numGlobalElements, size_t numLocalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node=Teuchos::rcp(new Node))
Constructor with a user-defined contiguous distribution.
GlobalOrdinal getMinGlobalIndex() const
The minimum global index owned by the calling process.
LocalOrdinal getMaxLocalIndex() const
The maximum local index on the calling process.
EpetraMapT(global_size_t numGlobalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, LocalGlobal lg=GloballyDistributed, const Teuchos::RCP< Node > &node=Teuchos::rcp(new Node))
Constructor with Tpetra-defined contiguous uniform distribution.
global_size_t getGlobalNumElements() const
The number of elements in this Map.
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Get this Map's Comm object.
global_size_t getGlobalNumElements() const
The number of elements in this Map.
const Epetra_BlockMap & getEpetra_BlockMap() const
Get the underlying Epetra map.
RCP< const Map< int, GlobalOrdinal, Node > > removeEmptyProcesses() const
Return a new Map with processes with zero elements removed.
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)
LocalOrdinal getMinLocalIndex() const
The minimum local index.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
#define IF_EPETRA_EXCEPTION_THEN_THROW_GLOBAL_INVALID_ARG(sourceCode)
bool isNodeGlobalElement(GlobalOrdinal globalIndex) const
Whether the given global index is valid for this Map on this process.
Teuchos::RCP< Node > getNode() const
Get this Map's Node object.
GlobalOrdinal getIndexBase() const
The index base for this Map.
LocalOrdinal getMinLocalIndex() const
The minimum local index.
std::string typeName(const T &t)
RCP< const Epetra_BlockMap > map_
global_size_t getGlobalNumElements() const
The number of elements in this Map.
bool isContiguous() const
True if this Map is distributed contiguously, else false.
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 Epetra_BlockMap > map_
GlobalOrdinal getIndexBase() const
The index base for this Map.
EpetraMapT(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=Teuchos::rcp(new Node))
Constructor with user-defined arbitrary (possibly noncontiguous) distribution.
virtual ~EpetraMapT()
Destructor.
GlobalOrdinal getIndexBase() const
The index base for this Map.
GlobalOrdinal getMaxGlobalIndex() const
The maximum global index owned by the calling process.
GlobalOrdinal getMinGlobalIndex() const
The minimum global index owned by the calling process.
GlobalOrdinal getMinAllGlobalIndex() const
The minimum global index over all processes in the communicator.
GlobalOrdinal global_ordinal_type
bool PointSameAs(const Epetra_BlockMap &Map) const
Teuchos::ArrayView< const GlobalOrdinal > getNodeElementList() const
Return a view of the global indices owned by this process.
size_t getNodeNumElements() const
The number of elements belonging to the calling process.
const Epetra_Map & getEpetra_Map() const
bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is compatible with this Map.
GlobalOrdinal global_ordinal_type
bool isNodeGlobalElement(GlobalOrdinal globalIndex) const
Whether the given global index is valid for this Map on this process.
bool MyLID(int lid) const
RCP< const Epetra_BlockMap > map_
size_t getNodeNumElements() const
The number of elements belonging to the calling process.
bool isDistributed() const
Whether this Map is globally distributed or locally replicated.
virtual ~EpetraMapT()
Destructor.
GlobalOrdinal getMinAllGlobalIndex() const
The minimum global index over all processes in the communicator.
Exception throws to report errors in the internal logical of the program.
EpetraMapT(global_size_t numGlobalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, LocalGlobal lg=GloballyDistributed, const Teuchos::RCP< Node > &node=Teuchos::rcp(new Node))
Constructor with Tpetra-defined contiguous uniform distribution.
RCP< const Map< int, GlobalOrdinal, Node > > replaceCommWithSubset(const Teuchos::RCP< const Teuchos::Comm< int > > &newComm) const
Replace this Map's communicator with a subset communicator.
bool isNodeLocalElement(LocalOrdinal localIndex) const
Whether the given local index is valid for this Map on this process.
bool isNodeGlobalElement(GlobalOrdinal globalIndex) const
Whether the given global index is valid for this Map on this 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< int, 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.
std::string description() const
Return a simple one-line description of this object.
int MyGlobalElements(int *MyGlobalElementList) const
GlobalOrdinal getMinAllGlobalIndex() const
The minimum global index over all processes in the communicator.
EpetraMapT(const Teuchos::RCP< const Epetra_BlockMap > &map)
EpetraMapT constructor to wrap a Epetra_Map object.
bool SameAs(const Epetra_BlockMap &Map) const
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.
bool isDistributed() const
Whether this Map is globally distributed or locally replicated.
size_t getNodeNumElements() const
The number of elements belonging to the calling process.
bool isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is identical to this Map.
Epetra_BlockMap * RemoveEmptyProcesses() const
bool isContiguous() const
True if this Map is distributed contiguously, else false.
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.
LocalOrdinal local_ordinal_type
bool DistributedGlobal() const
LocalOrdinal getMaxLocalIndex() const
The maximum local index on the calling process.
virtual ~EpetraMapT()
Destructor.
RCP< const Map< int, GlobalOrdinal, Node > > replaceCommWithSubset(const Teuchos::RCP< const Teuchos::Comm< int > > &newComm) const
Replace this Map's communicator with a subset communicator.
const Epetra_CrsGraph & toEpetra(const RCP< const CrsGraph< int, GlobalOrdinal, Node > > &graph)
bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is compatible with this Map.
EpetraMapT(global_size_t numGlobalElements, size_t numLocalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node=Teuchos::rcp(new Node))
Constructor with a user-defined contiguous distribution.
const Epetra_BlockMap & getEpetra_BlockMap() const
Get the underlying Epetra map.
RCP< const Map< int, GlobalOrdinal, Node > > removeEmptyProcesses() const
Return a new Map with processes with zero elements removed.
GlobalOrdinal getMaxAllGlobalIndex() const
The maximum global index over all processes in the communicator.
UnderlyingLib lib() const
Get the library used by this object (Epetra or Epetra?)
GlobalOrdinal getMaxGlobalIndex() const
The maximum global index owned by the calling process.
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...
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Get this Map's Comm object.
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...
LookupStatus getRemoteIndexList(const Teuchos::ArrayView< const GlobalOrdinal > &GIDList, const Teuchos::ArrayView< int > &nodeIDList) const
Return the process ranks for the given global indices.
EpetraMapT(global_size_t numGlobalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, LocalGlobal lg=GloballyDistributed, const Teuchos::RCP< Node > &node=Teuchos::rcp(new Node))
Constructor with Tpetra-defined contiguous uniform distribution.
bool isContiguous() const
True if this Map is distributed contiguously, else false.
bool isDistributed() const
Whether this Map is globally distributed or locally replicated.
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.
GlobalOrdinal getMaxGlobalIndex() const
The maximum global index owned by the calling process.
Teuchos::ArrayView< const GlobalOrdinal > getNodeElementList() const
Return a view of the global indices owned by this process.
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.
GlobalOrdinal getMaxAllGlobalIndex() const
The maximum global index over all processes in the communicator.
static const EVerbosityLevel verbLevel_default
Teuchos::RCP< Node > getNode() const
Get this Map's Node 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.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
#define XPETRA_MONITOR(funcName)
Teuchos::ArrayView< const GlobalOrdinal > getNodeElementList() const
Return a view of the global indices owned by this process.
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Get this Map's Comm object.
EpetraMapT(const Teuchos::RCP< const Epetra_BlockMap > &map)
EpetraMapT constructor to wrap a Epetra_Map object.
LocalOrdinal getMaxLocalIndex() const
The maximum local index on the calling process.
bool MyGID(int GID_in) const
UnderlyingLib lib() const
Get the library used by this object (Epetra or Epetra?)
EpetraMapT(const Teuchos::RCP< const Epetra_BlockMap > &map)
EpetraMapT constructor to wrap a Epetra_Map object.
LocalOrdinal getMinLocalIndex() const
The minimum local index.
EpetraMapT(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=Teuchos::rcp(new Node))
Constructor with user-defined arbitrary (possibly noncontiguous) distribution.
#define TEUCHOS_UNREACHABLE_RETURN(dummyReturnVal)