46 #ifndef XPETRA_EPETRAMAP_HPP
47 #define XPETRA_EPETRAMAP_HPP
51 #include "Xpetra_Map.hpp"
53 #include <Epetra_Map.h>
54 #include <Epetra_BlockMap.h>
62 #if defined(XPETRA_ENABLE_DEPRECATED_CODE)
64 #warning "The header file Trilinos/packages/xpetra/src/Map/Xpetra_EpetraMap.hpp is deprecated."
67 #error "The header file Trilinos/packages/xpetra/src/Map/Xpetra_EpetraMap.hpp is deprecated."
73 template <
class GlobalOrdinal,
class Node>
74 XPETRA_DEPRECATED
const Epetra_Map &
toEpetra(
const Map<int, GlobalOrdinal, Node> &);
76 template <
class GlobalOrdinal,
class Node>
77 XPETRA_DEPRECATED
const Epetra_Map &
toEpetra(
const RCP<
const Map<int, GlobalOrdinal, Node> > &);
82 template <
class GlobalOrdinal,
class Node>
83 XPETRA_DEPRECATED
const RCP<const Map<int, GlobalOrdinal, Node> >
toXpetra(
const Epetra_BlockMap &);
86 template <
class GlobalOrdinal,
class Node>
88 :
public virtual Map<int, GlobalOrdinal, Node> {
102 GlobalOrdinal indexBase,
103 const Teuchos::RCP<
const Teuchos::Comm<int> > &comm,
106 "Xpetra::EpetraMap only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
110 EpetraMapT(
global_size_t numGlobalElements,
size_t numLocalElements, GlobalOrdinal indexBase,
const Teuchos::RCP<
const Teuchos::Comm<int> > &comm) {
112 "Xpetra::EpetraMap only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
117 const Teuchos::ArrayView<const GlobalOrdinal> &elementList,
118 GlobalOrdinal indexBase,
119 const Teuchos::RCP<
const Teuchos::Comm<int> > &comm) {
121 "Xpetra::EpetraMap only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
166 Teuchos::ArrayView<const GlobalOrdinal>
getLocalElementList()
const {
return ArrayView<const GlobalOrdinal>(); }
200 Teuchos::RCP<const Teuchos::Comm<int> >
getComm()
const {
return Teuchos::null; }
211 void describe(Teuchos::FancyOStream & ,
const Teuchos::EVerbosityLevel = Teuchos::Describable::verbLevel_default)
const {}
222 RCP<const Map<int, GlobalOrdinal, Node> >
replaceCommWithSubset(
const Teuchos::RCP<
const Teuchos::Comm<int> > & )
const {
return Teuchos::null; }
239 "Xpetra::EpetraMap only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
246 const RCP<const Epetra_Map> &
getEpetra_MapRCP()
const {
return Teuchos::rcp_static_cast<
const Epetra_Map>(map_); }
250 #ifdef HAVE_XPETRA_TPETRA
254 throw std::runtime_error(
"Xpetra::EpetraMap::getLocalMap is not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
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."
265 RCP<const Epetra_BlockMap>
map_;
269 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
272 :
public virtual Map<int, int, EpetraNode> {
289 const Teuchos::RCP<
const Teuchos::Comm<int> > &comm,
293 std::string errPrefix;
294 errPrefix = Teuchos::typeName(*
this) +
"::constructor(numGlobal,indexBase,comm,lOrG): ";
297 const int myImageID = comm->getRank();
302 Teuchos::broadcast<int, global_size_t>(*comm, 0, &rootNGE);
303 Teuchos::broadcast<int, GlobalOrdinal>(*comm, 0, &rootIB);
304 int localChecks[2], globalChecks[2];
307 if (numGlobalElements != rootNGE) {
308 localChecks[0] = myImageID;
310 }
else if (indexBase != rootIB) {
311 localChecks[0] = myImageID;
316 Teuchos::reduceAll<int, int>(*comm, Teuchos::REDUCE_MAX, 2, localChecks, globalChecks);
317 if (globalChecks[0] != -1) {
318 if (globalChecks[1] == 1) {
319 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
320 errPrefix <<
"numGlobal must be the same on all nodes (examine node " << globalChecks[0] <<
").");
321 }
else if (globalChecks[1] == 2) {
322 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
323 errPrefix <<
"indexBase must be the same on all nodes (examine node " << globalChecks[0] <<
").");
326 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
327 errPrefix <<
"logic error. Please contact the Tpetra team.");
340 using Teuchos::outArg;
342 const size_t L0 = Teuchos::OrdinalTraits<size_t>::zero();
343 const size_t L1 = Teuchos::OrdinalTraits<size_t>::one();
344 const global_size_t GST0 = Teuchos::OrdinalTraits<global_size_t>::zero();
345 const global_size_t GST1 = Teuchos::OrdinalTraits<global_size_t>::one();
346 const global_size_t GSTI = Teuchos::OrdinalTraits<global_size_t>::invalid();
348 std::string errPrefix;
349 errPrefix = Teuchos::typeName(*
this) +
"::constructor(numGlobal,numLocal,indexBase,platform): ";
352 const int myImageID = comm->getRank();
357 int localChecks[2], globalChecks[2];
365 Teuchos::reduceAll<int, global_size_t>(*comm, Teuchos::REDUCE_SUM,
366 Teuchos::as<global_size_t>(numLocalElements), outArg(global_sum));
373 if (numLocalElements < L1 && numLocalElements != L0) {
375 localChecks[0] = myImageID;
377 }
else if (numGlobalElements < GST1 && numGlobalElements != GST0 && numGlobalElements != GSTI) {
379 localChecks[0] = myImageID;
381 }
else if (numGlobalElements != GSTI && numGlobalElements != global_sum) {
383 localChecks[0] = myImageID;
388 Teuchos::broadcast<int, GlobalOrdinal>(*comm, 0, &rootIB);
389 if (indexBase != rootIB) {
390 localChecks[0] = myImageID;
395 Teuchos::reduceAll<int, int>(*comm, Teuchos::REDUCE_MAX, 2, localChecks, globalChecks);
396 if (globalChecks[0] != -1) {
397 if (globalChecks[1] == 1) {
398 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
399 errPrefix <<
"numLocal is not valid on at least one node (possibly node "
400 << globalChecks[0] <<
").");
401 }
else if (globalChecks[1] == 2) {
402 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
403 errPrefix <<
"numGlobal is not valid on at least one node (possibly node "
404 << globalChecks[0] <<
").");
405 }
else if (globalChecks[1] == 3) {
406 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
407 errPrefix <<
"numGlobal doesn't match sum of numLocal (== "
408 << global_sum <<
") on at least one node (possibly node "
409 << globalChecks[0] <<
").");
410 }
else if (globalChecks[1] == 4) {
411 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
412 errPrefix <<
"indexBase is not the same on all nodes (examine node "
413 << globalChecks[0] <<
").");
416 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
417 errPrefix <<
"logic error. Please contact the Tpetra team.");
423 if (numGlobalElements == GSTI) {
424 numGlobalElements = global_sum;
432 const Teuchos::ArrayView<const GlobalOrdinal> &elementList,
434 const Teuchos::RCP<
const Teuchos::Comm<int> > &comm) {
435 if (numGlobalElements == Teuchos::OrdinalTraits<global_size_t>::invalid()) {
450 return map_->NumGlobalElements64();
456 return map_->NumMyElements();
468 return map_->MinLID();
474 return map_->MaxLID();
504 return map_->LID(globalIndex);
509 const Teuchos::ArrayView<int> &nodeIDList,
510 const Teuchos::ArrayView<LocalOrdinal> &LIDList)
const {
512 return toXpetra(
map_->RemoteIDList(static_cast<int>(GIDList.size()), GIDList.getRawPtr(), nodeIDList.getRawPtr(), LIDList.getRawPtr()));
517 const Teuchos::ArrayView<int> &nodeIDList)
const {
519 return toXpetra(
map_->RemoteIDList(static_cast<int>(GIDList.size()), GIDList.getRawPtr(), nodeIDList.getRawPtr(), 0));
525 return ArrayView<const int>(
map_->MyGlobalElements(),
map_->NumMyElements());
532 if (view.size() == 0)
535 return Kokkos::View<const global_ordinal_type *, typename Node::device_type, Kokkos::MemoryUnmanaged>(view.data(), view.size());
546 return map_->MyLID(localIndex);
552 return map_->MyGID(globalIndex);
558 return map_->LinearMap();
564 return map_->DistributedGlobal();
570 return map_->PointSameAs(toEpetra<GlobalOrdinal, Node>(map));
576 return map_->SameAs(toEpetra<GlobalOrdinal, Node>(map));
585 Teuchos::RCP<const Teuchos::Comm<int> >
getComm()
const {
600 std::ostringstream oss;
601 oss << Teuchos::Describable::description();
611 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default)
const {
614 const Teuchos::RCP<const Teuchos::Comm<int> > comm_ =
getComm();
619 using Teuchos::VERB_DEFAULT;
620 using Teuchos::VERB_EXTREME;
621 using Teuchos::VERB_HIGH;
622 using Teuchos::VERB_LOW;
623 using Teuchos::VERB_MEDIUM;
624 using Teuchos::VERB_NONE;
628 int myImageID = comm_->getRank();
629 int numImages = comm_->getSize();
631 Teuchos::EVerbosityLevel vl = verbLevel;
632 if (vl == VERB_DEFAULT) vl = VERB_LOW;
638 width = ::std::max<size_t>(width, (size_t)12) + 2;
640 Teuchos::OSTab tab(out);
642 if (vl == VERB_NONE) {
644 }
else if (vl == VERB_LOW) {
647 for (
int imageCtr = 0; imageCtr < numImages; ++imageCtr) {
648 if (myImageID == imageCtr) {
649 if (myImageID == 0) {
657 if (vl == VERB_HIGH || vl == VERB_EXTREME) {
658 out <<
"Number of Local Elements = " << nME << endl
663 if (vl == VERB_EXTREME) {
664 out << std::setw(width) <<
"Node ID"
665 << std::setw(width) <<
"Local Index"
666 << std::setw(width) <<
"Global Index"
668 for (
size_t i = 0; i < nME; i++) {
669 out << std::setw(width) << myImageID
670 << std::setw(width) << i
671 << std::setw(width) << myEntries[i]
692 const Epetra_BlockMap *NewMap =
map_->RemoveEmptyProcesses();
694 return Teuchos::null;
696 const RCP<const Map<int, GlobalOrdinal, Node> > NewMapX = toXpetra<GlobalOrdinal, Node>(*NewMap);
703 RCP<const Map<int, GlobalOrdinal, Node> >
replaceCommWithSubset(
const Teuchos::RCP<
const Teuchos::Comm<int> > & )
const {
704 throw std::runtime_error(
"Xpetra::EpetraMapT::replaceCommWithSubset has not yet been implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
705 TEUCHOS_UNREACHABLE_RETURN(Teuchos::null);
715 if (gid ==
map_->IndexBase64() - 1)
730 TEUCHOS_TEST_FOR_EXCEPTION(!map->GlobalIndicesIsType<
GlobalOrdinal>(), std::runtime_error,
"Xpetra::EpetraMapT: GlobalOrdinal mismatch.");
737 const RCP<const Epetra_Map>
getEpetra_MapRCP()
const {
return Teuchos::rcp_static_cast<
const Epetra_Map>(
map_); }
743 #ifdef HAVE_XPETRA_TPETRA
747 throw std::runtime_error(
"Xpetra::EpetraMap::getLocalMap is not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
754 #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."
759 RCP<const Epetra_BlockMap>
map_;
761 #endif // #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
764 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
767 :
public virtual Map<int, long long, EpetraNode> {
784 const Teuchos::RCP<
const Teuchos::Comm<int> > &comm,
788 std::string errPrefix;
789 errPrefix = Teuchos::typeName(*
this) +
"::constructor(numGlobal,indexBase,comm,lOrG): ";
792 const int myImageID = comm->getRank();
797 Teuchos::broadcast<int, global_size_t>(*comm, 0, &rootNGE);
798 Teuchos::broadcast<int, GlobalOrdinal>(*comm, 0, &rootIB);
799 int localChecks[2], globalChecks[2];
802 if (numGlobalElements != rootNGE) {
803 localChecks[0] = myImageID;
805 }
else if (indexBase != rootIB) {
806 localChecks[0] = myImageID;
811 Teuchos::reduceAll<int, int>(*comm, Teuchos::REDUCE_MAX, 2, localChecks, globalChecks);
812 if (globalChecks[0] != -1) {
813 if (globalChecks[1] == 1) {
814 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
815 errPrefix <<
"numGlobal must be the same on all nodes (examine node " << globalChecks[0] <<
").");
816 }
else if (globalChecks[1] == 2) {
817 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
818 errPrefix <<
"indexBase must be the same on all nodes (examine node " << globalChecks[0] <<
").");
821 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
822 errPrefix <<
"logic error. Please contact the Tpetra team.");
835 using Teuchos::outArg;
837 const size_t L0 = Teuchos::OrdinalTraits<size_t>::zero();
838 const size_t L1 = Teuchos::OrdinalTraits<size_t>::one();
839 const global_size_t GST0 = Teuchos::OrdinalTraits<global_size_t>::zero();
840 const global_size_t GST1 = Teuchos::OrdinalTraits<global_size_t>::one();
841 const global_size_t GSTI = Teuchos::OrdinalTraits<global_size_t>::invalid();
843 std::string errPrefix;
844 errPrefix = Teuchos::typeName(*
this) +
"::constructor(numGlobal,numLocal,indexBase,platform): ";
847 const int myImageID = comm->getRank();
852 int localChecks[2], globalChecks[2];
860 Teuchos::reduceAll<int, global_size_t>(*comm, Teuchos::REDUCE_SUM,
861 Teuchos::as<global_size_t>(numLocalElements), outArg(global_sum));
868 if (numLocalElements < L1 && numLocalElements != L0) {
870 localChecks[0] = myImageID;
872 }
else if (numGlobalElements < GST1 && numGlobalElements != GST0 && numGlobalElements != GSTI) {
874 localChecks[0] = myImageID;
876 }
else if (numGlobalElements != GSTI && numGlobalElements != global_sum) {
878 localChecks[0] = myImageID;
883 Teuchos::broadcast<int, GlobalOrdinal>(*comm, 0, &rootIB);
884 if (indexBase != rootIB) {
885 localChecks[0] = myImageID;
890 Teuchos::reduceAll<int, int>(*comm, Teuchos::REDUCE_MAX, 2, localChecks, globalChecks);
891 if (globalChecks[0] != -1) {
892 if (globalChecks[1] == 1) {
893 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
894 errPrefix <<
"numLocal is not valid on at least one node (possibly node "
895 << globalChecks[0] <<
").");
896 }
else if (globalChecks[1] == 2) {
897 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
898 errPrefix <<
"numGlobal is not valid on at least one node (possibly node "
899 << globalChecks[0] <<
").");
900 }
else if (globalChecks[1] == 3) {
901 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
902 errPrefix <<
"numGlobal doesn't match sum of numLocal (== "
903 << global_sum <<
") on at least one node (possibly node "
904 << globalChecks[0] <<
").");
905 }
else if (globalChecks[1] == 4) {
906 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
907 errPrefix <<
"indexBase is not the same on all nodes (examine node "
908 << globalChecks[0] <<
").");
911 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
912 errPrefix <<
"logic error. Please contact the Tpetra team.");
918 if (numGlobalElements == GSTI) {
919 numGlobalElements = global_sum;
927 const Teuchos::ArrayView<const GlobalOrdinal> &elementList,
929 const Teuchos::RCP<
const Teuchos::Comm<int> > &comm) {
930 if (numGlobalElements == Teuchos::OrdinalTraits<global_size_t>::invalid()) {
945 return map_->NumGlobalElements64();
951 return map_->NumMyElements();
963 return map_->MinLID();
969 return map_->MaxLID();
999 return map_->LID(globalIndex);
1003 LookupStatus getRemoteIndexList(
const Teuchos::ArrayView<const GlobalOrdinal> &GIDList,
const Teuchos::ArrayView<int> &nodeIDList,
const Teuchos::ArrayView<LocalOrdinal> &LIDList)
const {
1005 return toXpetra(
map_->RemoteIDList(GIDList.size(), GIDList.getRawPtr(), nodeIDList.getRawPtr(), LIDList.getRawPtr()));
1011 return toXpetra(
map_->RemoteIDList(GIDList.size(), GIDList.getRawPtr(), nodeIDList.getRawPtr(), 0));
1017 return ArrayView<const long long>(
map_->MyGlobalElements64(),
map_->NumMyElements());
1024 if (view.size() == 0)
1027 return Kokkos::View<const global_ordinal_type *, typename Node::device_type, Kokkos::MemoryUnmanaged>(view.data(), view.size());
1038 return map_->MyLID(localIndex);
1044 return map_->MyGID(globalIndex);
1050 return map_->LinearMap();
1056 return map_->DistributedGlobal();
1062 return map_->PointSameAs(toEpetra<GlobalOrdinal, Node>(map));
1068 return map_->SameAs(toEpetra<GlobalOrdinal, Node>(map));
1077 Teuchos::RCP<const Teuchos::Comm<int> >
getComm()
const {
1092 std::ostringstream oss;
1093 oss << Teuchos::Describable::description();
1103 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default)
const {
1106 const Teuchos::RCP<const Teuchos::Comm<int> > comm_ =
getComm();
1111 using Teuchos::VERB_DEFAULT;
1112 using Teuchos::VERB_EXTREME;
1113 using Teuchos::VERB_HIGH;
1114 using Teuchos::VERB_LOW;
1115 using Teuchos::VERB_MEDIUM;
1116 using Teuchos::VERB_NONE;
1120 int myImageID = comm_->getRank();
1121 int numImages = comm_->getSize();
1123 Teuchos::EVerbosityLevel vl = verbLevel;
1124 if (vl == VERB_DEFAULT) vl = VERB_LOW;
1130 width = ::std::max<size_t>(width, (size_t)12) + 2;
1132 Teuchos::OSTab tab(out);
1134 if (vl == VERB_NONE) {
1136 }
else if (vl == VERB_LOW) {
1139 for (
int imageCtr = 0; imageCtr < numImages; ++imageCtr) {
1140 if (myImageID == imageCtr) {
1141 if (myImageID == 0) {
1149 if (vl == VERB_HIGH || vl == VERB_EXTREME) {
1150 out <<
"Number of Local Elements = " << nME << endl
1155 if (vl == VERB_EXTREME) {
1156 out << std::setw(width) <<
"Node ID"
1157 << std::setw(width) <<
"Local Index"
1158 << std::setw(width) <<
"Global Index"
1160 for (
size_t i = 0; i < nME; i++) {
1161 out << std::setw(width) << myImageID
1162 << std::setw(width) << i
1163 << std::setw(width) << myEntries[i]
1184 const Epetra_BlockMap *NewMap =
map_->RemoveEmptyProcesses();
1186 return Teuchos::null;
1188 const RCP<const Map<int, GlobalOrdinal, Node> > NewMapX = toXpetra<GlobalOrdinal, Node>(*NewMap);
1195 RCP<const Map<int, GlobalOrdinal, Node> >
replaceCommWithSubset(
const Teuchos::RCP<
const Teuchos::Comm<int> > & )
const {
1196 throw std::runtime_error(
"Xpetra::EpetraMapT::replaceCommWithSubset has not yet been implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
1207 if (gid ==
map_->IndexBase64() - 1)
1222 TEUCHOS_TEST_FOR_EXCEPTION(!map->GlobalIndicesIsType<
GlobalOrdinal>(), std::runtime_error,
"Xpetra::EpetraMapT: GlobalOrdinal mismatch.");
1233 #ifdef HAVE_XPETRA_TPETRA
1237 throw std::runtime_error(
"Xpetra::EpetraMap::getLocalMap is not implemented in " + std::string(__FILE__) +
":" + std::to_string(__LINE__));
1244 #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."
1253 #endif // #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
1257 #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)