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."
39 template <
class GlobalOrdinal,
class Node>
40 XPETRA_DEPRECATED
const Epetra_Map &
toEpetra(
const Map<int, GlobalOrdinal, Node> &);
42 template <
class GlobalOrdinal,
class Node>
43 XPETRA_DEPRECATED
const Epetra_Map &
toEpetra(
const RCP<
const Map<int, GlobalOrdinal, Node> > &);
48 template <
class GlobalOrdinal,
class Node>
49 XPETRA_DEPRECATED
const RCP<const Map<int, GlobalOrdinal, Node> >
toXpetra(
const Epetra_BlockMap &);
52 template <
class GlobalOrdinal,
class Node>
54 :
public virtual Map<int, GlobalOrdinal, Node> {
68 GlobalOrdinal indexBase,
69 const Teuchos::RCP<
const Teuchos::Comm<int> > &comm,
72 "Xpetra::EpetraMap only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
76 EpetraMapT(
global_size_t numGlobalElements,
size_t numLocalElements, GlobalOrdinal indexBase,
const Teuchos::RCP<
const Teuchos::Comm<int> > &comm) {
78 "Xpetra::EpetraMap only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
83 const Teuchos::ArrayView<const GlobalOrdinal> &elementList,
84 GlobalOrdinal indexBase,
85 const Teuchos::RCP<
const Teuchos::Comm<int> > &comm) {
87 "Xpetra::EpetraMap only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
132 Teuchos::ArrayView<const GlobalOrdinal>
getLocalElementList()
const {
return ArrayView<const GlobalOrdinal>(); }
166 Teuchos::RCP<const Teuchos::Comm<int> >
getComm()
const {
return Teuchos::null; }
177 void describe(Teuchos::FancyOStream & ,
const Teuchos::EVerbosityLevel = Teuchos::Describable::verbLevel_default)
const {}
188 RCP<const Map<int, GlobalOrdinal, Node> >
replaceCommWithSubset(
const Teuchos::RCP<
const Teuchos::Comm<int> > & )
const {
return Teuchos::null; }
205 "Xpetra::EpetraMap only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
212 const RCP<const Epetra_Map> &
getEpetra_MapRCP()
const {
return Teuchos::rcp_static_cast<
const Epetra_Map>(map_); }
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."
231 RCP<const Epetra_BlockMap>
map_;
235 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
238 :
public virtual Map<int, int, EpetraNode> {
255 const Teuchos::RCP<
const Teuchos::Comm<int> > &comm,
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) {
285 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
286 errPrefix <<
"numGlobal must be the same on all nodes (examine node " << globalChecks[0] <<
").");
287 }
else if (globalChecks[1] == 2) {
288 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
289 errPrefix <<
"indexBase must be the same on all nodes (examine node " << globalChecks[0] <<
").");
292 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
293 errPrefix <<
"logic error. Please contact the Tpetra team.");
306 using Teuchos::outArg;
308 const size_t L0 = Teuchos::OrdinalTraits<size_t>::zero();
309 const size_t L1 = Teuchos::OrdinalTraits<size_t>::one();
310 const global_size_t GST0 = Teuchos::OrdinalTraits<global_size_t>::zero();
311 const global_size_t GST1 = Teuchos::OrdinalTraits<global_size_t>::one();
312 const global_size_t GSTI = Teuchos::OrdinalTraits<global_size_t>::invalid();
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) {
364 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
365 errPrefix <<
"numLocal is not valid on at least one node (possibly node "
366 << globalChecks[0] <<
").");
367 }
else if (globalChecks[1] == 2) {
368 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
369 errPrefix <<
"numGlobal is not valid on at least one node (possibly node "
370 << globalChecks[0] <<
").");
371 }
else if (globalChecks[1] == 3) {
372 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
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) {
377 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
378 errPrefix <<
"indexBase is not the same on all nodes (examine node "
379 << globalChecks[0] <<
").");
382 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
383 errPrefix <<
"logic error. Please contact the Tpetra team.");
389 if (numGlobalElements == GSTI) {
390 numGlobalElements = global_sum;
398 const Teuchos::ArrayView<const GlobalOrdinal> &elementList,
400 const Teuchos::RCP<
const Teuchos::Comm<int> > &comm) {
401 if (numGlobalElements == Teuchos::OrdinalTraits<global_size_t>::invalid()) {
416 return map_->NumGlobalElements64();
422 return map_->NumMyElements();
434 return map_->MinLID();
440 return map_->MaxLID();
470 return map_->LID(globalIndex);
475 const Teuchos::ArrayView<int> &nodeIDList,
476 const Teuchos::ArrayView<LocalOrdinal> &LIDList)
const {
478 return toXpetra(
map_->RemoteIDList(static_cast<int>(GIDList.size()), GIDList.getRawPtr(), nodeIDList.getRawPtr(), LIDList.getRawPtr()));
483 const Teuchos::ArrayView<int> &nodeIDList)
const {
485 return toXpetra(
map_->RemoteIDList(static_cast<int>(GIDList.size()), GIDList.getRawPtr(), nodeIDList.getRawPtr(), 0));
491 return ArrayView<const int>(
map_->MyGlobalElements(),
map_->NumMyElements());
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));
551 Teuchos::RCP<const Teuchos::Comm<int> >
getComm()
const {
566 std::ostringstream oss;
567 oss << Teuchos::Describable::description();
577 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default)
const {
580 const Teuchos::RCP<const Teuchos::Comm<int> > comm_ =
getComm();
585 using Teuchos::VERB_DEFAULT;
586 using Teuchos::VERB_EXTREME;
587 using Teuchos::VERB_HIGH;
588 using Teuchos::VERB_LOW;
589 using Teuchos::VERB_MEDIUM;
590 using Teuchos::VERB_NONE;
594 int myImageID = comm_->getRank();
595 int numImages = comm_->getSize();
597 Teuchos::EVerbosityLevel vl = verbLevel;
598 if (vl == VERB_DEFAULT) vl = VERB_LOW;
604 width = ::std::max<size_t>(width, (size_t)12) + 2;
606 Teuchos::OSTab tab(out);
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]
658 const Epetra_BlockMap *NewMap =
map_->RemoveEmptyProcesses();
660 return Teuchos::null;
662 const RCP<const Map<int, GlobalOrdinal, Node> > NewMapX = toXpetra<GlobalOrdinal, Node>(*NewMap);
669 RCP<const Map<int, GlobalOrdinal, Node> >
replaceCommWithSubset(
const Teuchos::RCP<
const Teuchos::Comm<int> > & )
const {
670 throw std::runtime_error(
"Xpetra::EpetraMapT::replaceCommWithSubset has not yet been implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
671 TEUCHOS_UNREACHABLE_RETURN(Teuchos::null);
681 if (gid ==
map_->IndexBase64() - 1)
696 TEUCHOS_TEST_FOR_EXCEPTION(!map->GlobalIndicesIsType<
GlobalOrdinal>(), std::runtime_error,
"Xpetra::EpetraMapT: GlobalOrdinal mismatch.");
703 const RCP<const Epetra_Map>
getEpetra_MapRCP()
const {
return Teuchos::rcp_static_cast<
const Epetra_Map>(
map_); }
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."
725 RCP<const Epetra_BlockMap>
map_;
727 #endif // #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
730 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
733 :
public virtual Map<int, long long, EpetraNode> {
750 const Teuchos::RCP<
const Teuchos::Comm<int> > &comm,
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) {
780 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
781 errPrefix <<
"numGlobal must be the same on all nodes (examine node " << globalChecks[0] <<
").");
782 }
else if (globalChecks[1] == 2) {
783 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
784 errPrefix <<
"indexBase must be the same on all nodes (examine node " << globalChecks[0] <<
").");
787 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
788 errPrefix <<
"logic error. Please contact the Tpetra team.");
801 using Teuchos::outArg;
803 const size_t L0 = Teuchos::OrdinalTraits<size_t>::zero();
804 const size_t L1 = Teuchos::OrdinalTraits<size_t>::one();
805 const global_size_t GST0 = Teuchos::OrdinalTraits<global_size_t>::zero();
806 const global_size_t GST1 = Teuchos::OrdinalTraits<global_size_t>::one();
807 const global_size_t GSTI = Teuchos::OrdinalTraits<global_size_t>::invalid();
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) {
859 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
860 errPrefix <<
"numLocal is not valid on at least one node (possibly node "
861 << globalChecks[0] <<
").");
862 }
else if (globalChecks[1] == 2) {
863 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
864 errPrefix <<
"numGlobal is not valid on at least one node (possibly node "
865 << globalChecks[0] <<
").");
866 }
else if (globalChecks[1] == 3) {
867 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
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) {
872 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
873 errPrefix <<
"indexBase is not the same on all nodes (examine node "
874 << globalChecks[0] <<
").");
877 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
878 errPrefix <<
"logic error. Please contact the Tpetra team.");
884 if (numGlobalElements == GSTI) {
885 numGlobalElements = global_sum;
893 const Teuchos::ArrayView<const GlobalOrdinal> &elementList,
895 const Teuchos::RCP<
const Teuchos::Comm<int> > &comm) {
896 if (numGlobalElements == Teuchos::OrdinalTraits<global_size_t>::invalid()) {
911 return map_->NumGlobalElements64();
917 return map_->NumMyElements();
929 return map_->MinLID();
935 return map_->MaxLID();
965 return map_->LID(globalIndex);
969 LookupStatus getRemoteIndexList(
const Teuchos::ArrayView<const GlobalOrdinal> &GIDList,
const Teuchos::ArrayView<int> &nodeIDList,
const Teuchos::ArrayView<LocalOrdinal> &LIDList)
const {
971 return toXpetra(
map_->RemoteIDList(GIDList.size(), GIDList.getRawPtr(), nodeIDList.getRawPtr(), LIDList.getRawPtr()));
977 return toXpetra(
map_->RemoteIDList(GIDList.size(), GIDList.getRawPtr(), nodeIDList.getRawPtr(), 0));
983 return ArrayView<const long long>(
map_->MyGlobalElements64(),
map_->NumMyElements());
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));
1043 Teuchos::RCP<const Teuchos::Comm<int> >
getComm()
const {
1058 std::ostringstream oss;
1059 oss << Teuchos::Describable::description();
1069 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default)
const {
1072 const Teuchos::RCP<const Teuchos::Comm<int> > comm_ =
getComm();
1077 using Teuchos::VERB_DEFAULT;
1078 using Teuchos::VERB_EXTREME;
1079 using Teuchos::VERB_HIGH;
1080 using Teuchos::VERB_LOW;
1081 using Teuchos::VERB_MEDIUM;
1082 using Teuchos::VERB_NONE;
1086 int myImageID = comm_->getRank();
1087 int numImages = comm_->getSize();
1089 Teuchos::EVerbosityLevel vl = verbLevel;
1090 if (vl == VERB_DEFAULT) vl = VERB_LOW;
1096 width = ::std::max<size_t>(width, (size_t)12) + 2;
1098 Teuchos::OSTab tab(out);
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]
1150 const Epetra_BlockMap *NewMap =
map_->RemoveEmptyProcesses();
1152 return Teuchos::null;
1154 const RCP<const Map<int, GlobalOrdinal, Node> > NewMapX = toXpetra<GlobalOrdinal, Node>(*NewMap);
1161 RCP<const Map<int, GlobalOrdinal, Node> >
replaceCommWithSubset(
const Teuchos::RCP<
const Teuchos::Comm<int> > & )
const {
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)
1188 TEUCHOS_TEST_FOR_EXCEPTION(!map->GlobalIndicesIsType<
GlobalOrdinal>(), std::runtime_error,
"Xpetra::EpetraMapT: GlobalOrdinal mismatch.");
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."
1219 #endif // #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
1223 #endif // XPETRA_EPETRAMAP_HPP
Map< LocalOrdinal, GlobalOrdinal, Node >::global_indices_array_device_type global_indices_array_device_type
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.
GlobalOrdinal global_ordinal_type
virtual ~EpetraMapT()
Destructor.
GlobalOrdinal getIndexBase() const
The index base for this Map.
GlobalOrdinal getIndexBase() const
The index base for this Map.
std::string description() const
Return a simple one-line description of this object.
bool isDistributed() const
Whether this Map is globally distributed or locally replicated.
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.
typename Map< LocalOrdinal, GlobalOrdinal, Node >::local_map_type local_map_type
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.
GlobalOrdinal global_ordinal_type
Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >::local_map_type local_map_type
LocalOrdinal local_ordinal_type
const Epetra_BlockMap & getEpetra_BlockMap() const
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 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.
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.
GlobalOrdinal getMinAllGlobalIndex() const
The minimum global index over all processes in the communicator.
std::string description() const
Return a simple one-line description of this object.
UnderlyingLib lib() const
Get the library used by this object (Epetra or Epetra?)
GlobalOrdinal getIndexBase() const
The index base for this Map.
bool isContiguous() const
True if this Map is distributed contiguously, else false.
LocalOrdinal getMaxLocalIndex() const
The maximum local index on the calling process.
const Epetra_BlockMap & getEpetra_BlockMap() const
GlobalOrdinal getMaxAllGlobalIndex() const
The maximum global index over all processes in the communicator.
LocalOrdinal getMaxLocalIndex() const
The maximum local index on the calling process.
Exception throws to report errors in the internal logical of the program.
bool isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is identical to this Map.
bool isContiguous() const
True if this Map is distributed contiguously, else false.
const Epetra_Map & getEpetra_Map() const
UnderlyingLib lib() const
Get the library used by this object (Epetra or Epetra?)
GlobalOrdinal getMinAllGlobalIndex() const
The minimum global index over all processes in the communicator.
bool isNodeGlobalElement(GlobalOrdinal) 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.
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
Return the process ranks for the given global indices.
LocalOrdinal getMaxLocalIndex() const
The maximum local index on the calling process.
LocalOrdinal getMinLocalIndex() const
The minimum local index.
Teuchos::ArrayView< const GlobalOrdinal > getLocalElementList() const
Return a view of the global indices owned by 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.
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.
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.
Map< LocalOrdinal, GlobalOrdinal, Node >::global_indices_array_type global_indices_array_type
LocalOrdinal getMinLocalIndex() const
The minimum local index.
RCP< const Map< int, GlobalOrdinal, Node > > removeEmptyProcesses() const
Return a new Map with processes with zero elements removed.
bool isDistributed() const
Whether this Map is globally distributed or locally replicated.
bool isContiguous() const
True if this Map is distributed contiguously, else false.
bool isNodeLocalElement(LocalOrdinal localIndex) const
Whether the given local index is valid for this Map on this 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.
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.
typename Map< LocalOrdinal, GlobalOrdinal, Node >::local_map_type local_map_type
bool isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &) const
True if and only if map is identical to this Map.
typename Map< LocalOrdinal, GlobalOrdinal, Node >::local_map_type local_map_type
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.
size_t getLocalNumElements() 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.
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Get this Map's Comm object.
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Get this Map's Comm object.
bool isNodeLocalElement(LocalOrdinal localIndex) const
Whether the given local index is valid for this Map on this process.
LocalOrdinal getMinLocalIndex() const
The minimum local index.
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.
const Epetra_Map & getEpetra_Map() const
RCP< const Epetra_BlockMap > map_
#define IF_EPETRA_EXCEPTION_THEN_THROW_GLOBAL_INVALID_ARG(sourceCode)
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.
const Epetra_BlockMap & getEpetra_BlockMap() const
virtual ~EpetraMapT()
Destructor.
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.
global_size_t getGlobalNumElements() const
The number of elements in this Map.
GlobalOrdinal getMaxGlobalIndex() const
The maximum global index owned by the calling process.
GlobalOrdinal getMaxAllGlobalIndex() const
The maximum global index over all processes in the communicator.
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.
RCP< const Map< int, GlobalOrdinal, Node > > replaceCommWithSubset(const Teuchos::RCP< const Teuchos::Comm< int > > &) const
Replace this Map's communicator with a subset communicator.
RCP< const Epetra_BlockMap > map_
size_t global_size_t
Global size_t object.
global_size_t getGlobalNumElements() const
The number of elements in this Map.
size_t getLocalNumElements() const
The number of elements belonging to the calling process.
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.
Kokkos::View< const global_ordinal_type *, typename Node::device_type > global_indices_array_device_type
RCP< const Epetra_BlockMap > 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.
RCP< const Map< int, GlobalOrdinal, Node > > removeEmptyProcesses() const
Return a new Map with processes with zero elements removed.
local_map_type getLocalMap() const
Get the local Map for Kokkos kernels.
EpetraMapT(const Teuchos::RCP< const Epetra_BlockMap > &map)
EpetraMapT constructor to wrap a Epetra_Map 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...
UnderlyingLib lib() const
Get the library used by this object (Epetra or Epetra?)
Tpetra::KokkosCompat::KokkosSerialWrapperNode EpetraNode
GlobalOrdinal getMinGlobalIndex() const
The minimum global index owned by the calling process.
const Epetra_Map & getEpetra_Map() const
RCP< const Map< int, GlobalOrdinal, Node > > removeEmptyProcesses() const
Return a new Map with processes with zero elements removed.
bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is compatible with this Map.
GlobalOrdinal global_ordinal_type
virtual ~EpetraMapT()
Destructor.
LocalOrdinal local_ordinal_type
const RCP< const Epetra_Map > & getEpetra_MapRCP() const
Get the underlying Epetra map.
size_t getLocalNumElements() const
The number of elements belonging to the calling process.
bool isNodeLocalElement(LocalOrdinal) const
Whether the given local index is valid for this Map on this process.
LocalOrdinal getLocalElement(GlobalOrdinal) const
The local index corresponding to the given global index.
#define XPETRA_MONITOR(funcName)
LocalOrdinal getLocalElement(GlobalOrdinal globalIndex) const
The local index corresponding to the given global index.
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.
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.
bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is compatible with 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.
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(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 getMinAllGlobalIndex() const
The minimum 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.
global_indices_array_device_type getMyGlobalIndicesDevice() const
Return a view of the global indices owned by this 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.
GlobalOrdinal getMaxAllGlobalIndex() const
The maximum global index over all processes in the communicator.
bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &) const
True if and only if map is compatible with 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.
Teuchos::ArrayView< const GlobalOrdinal > getLocalElementList() const
Return a view of the global indices owned by this process.
LookupStatus getRemoteIndexList(const Teuchos::ArrayView< const GlobalOrdinal > &, const Teuchos::ArrayView< int > &) const
Return the process ranks for the given global indices.
const Epetra_CrsGraph & toEpetra(const RCP< const CrsGraph< int, GlobalOrdinal, Node > > &graph)
std::string description() const
Return a simple one-line description of this object.
local_map_type getLocalMap() const
Get the local Map for Kokkos kernels.
global_indices_array_device_type getMyGlobalIndicesDevice() const
Return a view of the global indices owned by this process.
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)