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>
290 GlobalOrdinal indexBase,
297 std::string errPrefix;
298 errPrefix =
Teuchos::typeName(*
this) +
"::constructor(numGlobal,indexBase,comm,lOrG): ";
301 const int myImageID = comm->getRank();
305 GlobalOrdinal rootIB = indexBase;
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;
397 GlobalOrdinal rootIB = indexBase;
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;}
447 GlobalOrdinal indexBase,
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.");
664 GlobalOrdinal gid = (GlobalOrdinal)
map_->GID64(localIndex);
665 if (gid ==
map_->IndexBase64()-1)
return (-1);
678 TEUCHOS_TEST_FOR_EXCEPTION(!map->GlobalIndicesIsType<GlobalOrdinal>(), std::runtime_error,
"Xpetra::EpetraMapT: GlobalOrdinal mismatch.");
691 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR 692 #ifdef HAVE_XPETRA_TPETRA 695 local_map_type getLocalMap ()
const {
696 if (isInitializedLocalMap_)
699 typedef GlobalOrdinal
GO;
700 typedef LocalOrdinal
LO;
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>
817 GlobalOrdinal indexBase,
823 std::string errPrefix;
824 errPrefix =
Teuchos::typeName(*
this) +
"::constructor(numGlobal,indexBase,comm,lOrG): ";
827 const int myImageID = comm->getRank();
831 GlobalOrdinal rootIB = indexBase;
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;
922 GlobalOrdinal rootIB = indexBase;
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;}
972 GlobalOrdinal indexBase,
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.");
1188 GlobalOrdinal gid = (GlobalOrdinal)
map_->GID64(localIndex);
1189 if (gid ==
map_->IndexBase64()-1)
return (-1);
1202 TEUCHOS_TEST_FOR_EXCEPTION(!map->GlobalIndicesIsType<GlobalOrdinal>(), std::runtime_error,
"Xpetra::EpetraMapT: GlobalOrdinal mismatch.");
1213 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR 1214 #ifdef HAVE_XPETRA_TPETRA 1217 local_map_type getLocalMap ()
const {
1218 if (isInitializedLocalMap_)
1221 typedef GlobalOrdinal
GO;
1222 typedef LocalOrdinal
LO;
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 global_ordinal_type
virtual ~EpetraMapT()
Destructor.
Teuchos::RCP< Node > getNode() const
Get this Map's Node object.
int MyGlobalElements(int *MyGlobalElementList) const
bool MyLID(int lid) const
LocalOrdinal getMaxLocalIndex() const
The maximum local index on the calling process.
UnderlyingLib lib() const
Get the library used by this object (Epetra or Epetra?)
global_size_t getGlobalNumElements() const
The number of elements in this Map.
UnderlyingLib lib() const
Get the library used by this object (Epetra or Epetra?)
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_BlockMap & getEpetra_BlockMap() const
Get the underlying Epetra map.
GlobalOrdinal global_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.
LocalOrdinal getLocalElement(GlobalOrdinal globalIndex) const
The local index corresponding to the given global index.
LocalOrdinal local_ordinal_type
GlobalOrdinal getMinGlobalIndex() const
The minimum 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 DistributedGlobal() const
std::string description() const
Return a simple one-line description of this object.
RCP< const Map< int, GlobalOrdinal, Node > > removeEmptyProcesses() const
Return a new Map with processes with zero elements removed.
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Get this Map's Comm object.
bool SameAs(const Epetra_BlockMap &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.
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.
EpetraMapT(const Teuchos::RCP< const Epetra_BlockMap > &map)
EpetraMapT constructor to wrap a Epetra_Map object.
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.
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.
GlobalOrdinal getMaxAllGlobalIndex() const
The maximum global index over all processes in the communicator.
bool isDistributed() const
Whether this Map is globally distributed or locally replicated.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Epetra_BlockMap * RemoveEmptyProcesses() const
LocalOrdinal getMinLocalIndex() const
The minimum local index.
bool isNodeLocalElement(LocalOrdinal localIndex) const
Whether the given local index is valid for this Map on this process.
Exception throws to report errors in the internal logical of the program.
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.
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Get this Map's Comm object.
const Epetra_CrsGraph & toEpetra(const RCP< const CrsGraph< int, GlobalOrdinal, Node > > &graph)
RCP< const Map< int, GlobalOrdinal, Node > > removeEmptyProcesses() const
Return a new Map with processes with zero elements removed.
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.
EpetraMapT(const Teuchos::RCP< const Epetra_BlockMap > &map)
EpetraMapT constructor to wrap a Epetra_Map object.
const Epetra_BlockMap & getEpetra_BlockMap() const
Get the underlying Epetra map.
virtual std::string description() const
GlobalOrdinal getMaxGlobalIndex() const
The maximum global index owned by the calling process.
UnderlyingLib lib() const
Get the library used by this object (Epetra or Epetra?)
Teuchos::ArrayView< const GlobalOrdinal > getNodeElementList() const
Return a view of the global indices owned by this process.
LocalOrdinal getMaxLocalIndex() const
The maximum local index on the calling process.
GlobalOrdinal getMaxAllGlobalIndex() const
The maximum global index over all processes in the communicator.
GlobalOrdinal getIndexBase() const
The index base for this Map.
bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is compatible with this Map.
const Epetra_Map & getEpetra_Map() const
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.
LocalOrdinal getLocalElement(GlobalOrdinal globalIndex) const
The local index corresponding to the given global index.
bool isNodeLocalElement(LocalOrdinal localIndex) const
Whether the given local index is valid for this Map on this 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...
bool isContiguous() const
True if this Map is distributed contiguously, else false.
bool isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is identical to this Map.
bool MyGID(int GID_in) const
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 isNodeGlobalElement(GlobalOrdinal globalIndex) const
Whether the given global index is valid for this Map on this process.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
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.
GlobalOrdinal getMinAllGlobalIndex() const
The minimum global index over all processes in the communicator.
size_t getNodeNumElements() const
The number of elements belonging to the calling process.
bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is compatible with this Map.
GlobalOrdinal getIndexBase() const
The index base for this Map.
std::string description() const
Return a simple one-line description of this object.
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.
int NumMyElements() const
bool isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is identical to this Map.
RCP< const Epetra_BlockMap > map_
bool isNodeGlobalElement(GlobalOrdinal globalIndex) const
Whether the given global index is valid for this Map on this process.
#define IF_EPETRA_EXCEPTION_THEN_THROW_GLOBAL_INVALID_ARG(sourceCode)
GlobalOrdinal getMinGlobalIndex() const
The minimum global index owned by the calling process.
bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is compatible with this Map.
bool isContiguous() const
True if this Map is distributed contiguously, else false.
size_t getNodeNumElements() const
The number of elements belonging to the calling process.
const Epetra_Comm & Comm() const
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.
int RemoteIDList(int NumIDs, const int *GIDList, int *PIDList, int *LIDList) const
LocalOrdinal getMinLocalIndex() const
The minimum local index.
RCP< const Epetra_BlockMap > map_
size_t global_size_t
Global size_t object.
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.
Teuchos::RCP< Node > getNode() const
Get this Map's Node object.
static const EVerbosityLevel verbLevel_default
RCP< const Epetra_BlockMap > map_
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 Teuchos::ArrayView< LocalOrdinal > &LIDList) const
Return the process ranks and corresponding local indices for the given global indices.
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.
EpetraMapT(const Teuchos::RCP< const Epetra_BlockMap > &map)
EpetraMapT constructor to wrap a Epetra_Map object.
size_t getNodeNumElements() const
The number of elements belonging to the calling process.
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
Return the process ranks for the given global indices.
#define TEUCHOS_UNREACHABLE_RETURN(dummyReturnVal)
LocalOrdinal getLocalElement(GlobalOrdinal globalIndex) const
The local index corresponding to the given global index.
GlobalOrdinal getMinAllGlobalIndex() const
The minimum global index over all processes in the communicator.
LocalOrdinal getMaxLocalIndex() const
The maximum local index on the calling process.
bool isDistributed() const
Whether this Map is globally distributed or locally replicated.
GlobalOrdinal global_ordinal_type
virtual ~EpetraMapT()
Destructor.
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.
GlobalOrdinal getMaxAllGlobalIndex() const
The maximum global index over all processes in the communicator.
bool isContiguous() const
True if this Map is distributed contiguously, else false.
GlobalOrdinal getMinGlobalIndex() const
The minimum global index owned by the calling process.
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 > &GIDList, const Teuchos::ArrayView< int > &nodeIDList) const
Return the process ranks for the given global indices.
#define XPETRA_MONITOR(funcName)
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.
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.
bool isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is identical to this Map.
Teuchos::ArrayView< const GlobalOrdinal > getNodeElementList() const
Return a view of the global indices owned by this 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...
const Epetra_BlockMap & getEpetra_BlockMap() const
Get the underlying Epetra map.
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.
const Epetra_Map & getEpetra_Map() 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.
LocalOrdinal getMinLocalIndex() const
The minimum local index.
std::string description() const
Return a simple one-line description of this object.
bool PointSameAs(const Epetra_BlockMap &Map) const
GlobalOrdinal getMaxGlobalIndex() const
The maximum global index owned by the calling process.
std::string typeName(const T &t)