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>
67 const Epetra_Map &
toEpetra(
const Map<int,GlobalOrdinal, Node> &);
68 template<
class GlobalOrdinal,
class Node>
69 const Epetra_Map &
toEpetra(
const RCP<
const Map<int, GlobalOrdinal, Node> > &);
72 template<
class GlobalOrdinal,
class Node>
73 const RCP< const Map<int, GlobalOrdinal, Node> >
toXpetra(
const Epetra_BlockMap &);
76 template<
class GlobalOrdinal,
class Node>
78 :
public virtual Map<int, GlobalOrdinal, Node>
92 GlobalOrdinal indexBase,
93 const Teuchos::RCP<
const Teuchos::Comm< int > > &comm,
95 const Teuchos::RCP< Node > &node = Teuchos::rcp (
new Node))
98 "Xpetra::EpetraMap only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
102 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)) {
104 "Xpetra::EpetraMap only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
109 const Teuchos::ArrayView< const GlobalOrdinal > &elementList,
110 GlobalOrdinal indexBase,
111 const Teuchos::RCP<
const Teuchos::Comm< int > > &comm,
112 const Teuchos::RCP< Node > &node = Teuchos::rcp(
new Node)) {
114 "Xpetra::EpetraMap only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
161 Teuchos::ArrayView< const GlobalOrdinal >
getNodeElementList()
const {
return ArrayView< const GlobalOrdinal >(); }
191 Teuchos::RCP< const Teuchos::Comm< int > >
getComm()
const {
return Teuchos::null; }
196 return Teuchos::rcp (
new Node);
208 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default)
const { }
219 RCP<const Map<int,GlobalOrdinal,Node> >
replaceCommWithSubset(
const Teuchos::RCP<
const Teuchos::Comm< int > > &newComm)
const {
return Teuchos::null; }
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)");
254 TEUCHOS_UNREACHABLE_RETURN(local_map_type());
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."
267 RCP<const Epetra_BlockMap>
map_;
271 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
274 :
public virtual Map<int, int, EpetraNode>
291 const Teuchos::RCP<
const Teuchos::Comm< int > > &comm,
293 const Teuchos::RCP< Node > &node = Teuchos::rcp(
new Node))
297 std::string errPrefix;
298 errPrefix = Teuchos::typeName(*
this) +
"::constructor(numGlobal,indexBase,comm,lOrG): ";
301 const int myImageID = comm->getRank();
306 Teuchos::broadcast<int,global_size_t>(*comm,0,&rootNGE);
307 Teuchos::broadcast<int,GlobalOrdinal>(*comm,0,&rootIB);
308 int localChecks[2], globalChecks[2];
311 if (numGlobalElements != rootNGE) {
312 localChecks[0] = myImageID;
315 else if (indexBase != rootIB) {
316 localChecks[0] = myImageID;
321 Teuchos::reduceAll<int,int>(*comm,Teuchos::REDUCE_MAX,2,localChecks,globalChecks);
322 if (globalChecks[0] != -1) {
323 if (globalChecks[1] == 1) {
324 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
325 errPrefix <<
"numGlobal must be the same on all nodes (examine node " << globalChecks[0] <<
").");
327 else if (globalChecks[1] == 2) {
328 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
329 errPrefix <<
"indexBase must be the same on all nodes (examine node " << globalChecks[0] <<
").");
333 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::logic_error,
334 errPrefix <<
"logic error. Please contact the Tpetra team.");
348 using Teuchos::outArg;
350 const size_t L0 = Teuchos::OrdinalTraits<size_t>::zero();
351 const size_t L1 = Teuchos::OrdinalTraits<size_t>::one();
352 const global_size_t GST0 = Teuchos::OrdinalTraits<global_size_t>::zero();
353 const global_size_t GST1 = Teuchos::OrdinalTraits<global_size_t>::one();
354 const global_size_t GSTI = Teuchos::OrdinalTraits<global_size_t>::invalid();
356 std::string errPrefix;
357 errPrefix = Teuchos::typeName(*
this) +
"::constructor(numGlobal,numLocal,indexBase,platform): ";
360 const int myImageID = comm->getRank();
365 int localChecks[2], globalChecks[2];
373 Teuchos::reduceAll<int,global_size_t>(*comm,Teuchos::REDUCE_SUM,
374 Teuchos::as<global_size_t>(numLocalElements),outArg(global_sum));
381 if (numLocalElements < L1 && numLocalElements != L0) {
383 localChecks[0] = myImageID;
386 else if (numGlobalElements < GST1 && numGlobalElements != GST0 && numGlobalElements != GSTI) {
388 localChecks[0] = myImageID;
391 else if (numGlobalElements != GSTI && numGlobalElements != global_sum) {
393 localChecks[0] = myImageID;
398 Teuchos::broadcast<int,GlobalOrdinal>(*comm,0,&rootIB);
399 if (indexBase != rootIB) {
400 localChecks[0] = myImageID;
405 Teuchos::reduceAll<int,int>(*comm,Teuchos::REDUCE_MAX,2,localChecks,globalChecks);
406 if (globalChecks[0] != -1) {
407 if (globalChecks[1] == 1) {
408 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
409 errPrefix <<
"numLocal is not valid on at least one node (possibly node "
410 << globalChecks[0] <<
").");
412 else if (globalChecks[1] == 2) {
413 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
414 errPrefix <<
"numGlobal is not valid on at least one node (possibly node "
415 << globalChecks[0] <<
").");
417 else if (globalChecks[1] == 3) {
418 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
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) {
424 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
425 errPrefix <<
"indexBase is not the same on all nodes (examine node "
426 << globalChecks[0] <<
").");
430 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::logic_error,
431 errPrefix <<
"logic error. Please contact the Tpetra team.");
438 if (numGlobalElements == GSTI) {
439 numGlobalElements = global_sum;}
446 const Teuchos::ArrayView< const GlobalOrdinal > &elementList,
448 const Teuchos::RCP<
const Teuchos::Comm< int > > &comm,
449 const Teuchos::RCP< Node > &node = Teuchos::rcp(
new Node))
451 if (numGlobalElements == Teuchos::OrdinalTraits<global_size_t>::invalid()) {
494 LookupStatus getRemoteIndexList(
const Teuchos::ArrayView< const GlobalOrdinal > &GIDList,
const Teuchos::ArrayView< int > &nodeIDList,
const Teuchos::ArrayView< LocalOrdinal > &LIDList)
const {
XPETRA_MONITOR(
"EpetraMapT::getRemoteIndexList");
return toXpetra(
map_->RemoteIDList(static_cast<int>(GIDList.size()), GIDList.getRawPtr(), nodeIDList.getRawPtr(), LIDList.getRawPtr())); }
497 LookupStatus getRemoteIndexList(
const Teuchos::ArrayView< const GlobalOrdinal > &GIDList,
const Teuchos::ArrayView< int > &nodeIDList)
const {
XPETRA_MONITOR(
"EpetraMapT::getRemoteIndexList");
return toXpetra(
map_->RemoteIDList(static_cast<int>(GIDList.size()), GIDList.getRawPtr(), nodeIDList.getRawPtr(), 0)); }
535 return Teuchos::rcp (
new Node);
548 std::ostringstream oss;
549 oss << Teuchos::Describable::description();
559 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default)
const {
562 const Teuchos::RCP<const Teuchos::Comm<int> > comm_ =
getComm();
567 using Teuchos::VERB_DEFAULT;
568 using Teuchos::VERB_NONE;
569 using Teuchos::VERB_LOW;
570 using Teuchos::VERB_MEDIUM;
571 using Teuchos::VERB_HIGH;
572 using Teuchos::VERB_EXTREME;
576 int myImageID = comm_->getRank();
577 int numImages = comm_->getSize();
579 Teuchos::EVerbosityLevel vl = verbLevel;
580 if (vl == VERB_DEFAULT) vl = VERB_LOW;
586 width = ::std::max<size_t>(width, (
size_t) 12) + 2;
588 Teuchos::OSTab tab(out);
590 if (vl == VERB_NONE) {
593 else if (vl == VERB_LOW) {
597 for (
int imageCtr = 0; imageCtr < numImages; ++imageCtr) {
598 if (myImageID == imageCtr) {
599 if (myImageID == 0) {
607 if (vl == VERB_HIGH || vl == VERB_EXTREME) {
608 out <<
"Number of Local Elements = " << nME << endl
613 if (vl == VERB_EXTREME) {
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]
642 const Epetra_BlockMap * NewMap =
map_->RemoveEmptyProcesses();
644 return Teuchos::null;
646 const RCP< const Map<int, GlobalOrdinal, Node> > NewMapX = toXpetra<GlobalOrdinal, Node>(*NewMap);
653 RCP<const Map<int,GlobalOrdinal,Node> >
replaceCommWithSubset(
const Teuchos::RCP<
const Teuchos::Comm< int > > &newComm)
const {
654 throw std::runtime_error(
"Xpetra::EpetraMapT::replaceCommWithSubset has not yet been implemented.");
655 TEUCHOS_UNREACHABLE_RETURN(Teuchos::null);
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;
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;
712 size_t numLocalElements =
map_->NumMyElements();
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."
793 RCP<const Epetra_BlockMap>
map_;
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>
818 const Teuchos::RCP<
const Teuchos::Comm< int > > &comm,
820 const Teuchos::RCP< Node > &node = Teuchos::rcp(
new Node)) {
823 std::string errPrefix;
824 errPrefix = Teuchos::typeName(*
this) +
"::constructor(numGlobal,indexBase,comm,lOrG): ";
827 const int myImageID = comm->getRank();
832 Teuchos::broadcast<int,global_size_t>(*comm,0,&rootNGE);
833 Teuchos::broadcast<int,GlobalOrdinal>(*comm,0,&rootIB);
834 int localChecks[2], globalChecks[2];
837 if (numGlobalElements != rootNGE) {
838 localChecks[0] = myImageID;
841 else if (indexBase != rootIB) {
842 localChecks[0] = myImageID;
847 Teuchos::reduceAll<int,int>(*comm,Teuchos::REDUCE_MAX,2,localChecks,globalChecks);
848 if (globalChecks[0] != -1) {
849 if (globalChecks[1] == 1) {
850 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
851 errPrefix <<
"numGlobal must be the same on all nodes (examine node " << globalChecks[0] <<
").");
853 else if (globalChecks[1] == 2) {
854 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
855 errPrefix <<
"indexBase must be the same on all nodes (examine node " << globalChecks[0] <<
").");
859 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::logic_error,
860 errPrefix <<
"logic error. Please contact the Tpetra team.");
873 using Teuchos::outArg;
875 const size_t L0 = Teuchos::OrdinalTraits<size_t>::zero();
876 const size_t L1 = Teuchos::OrdinalTraits<size_t>::one();
877 const global_size_t GST0 = Teuchos::OrdinalTraits<global_size_t>::zero();
878 const global_size_t GST1 = Teuchos::OrdinalTraits<global_size_t>::one();
879 const global_size_t GSTI = Teuchos::OrdinalTraits<global_size_t>::invalid();
881 std::string errPrefix;
882 errPrefix = Teuchos::typeName(*
this) +
"::constructor(numGlobal,numLocal,indexBase,platform): ";
885 const int myImageID = comm->getRank();
890 int localChecks[2], globalChecks[2];
898 Teuchos::reduceAll<int,global_size_t>(*comm,Teuchos::REDUCE_SUM,
899 Teuchos::as<global_size_t>(numLocalElements),outArg(global_sum));
906 if (numLocalElements < L1 && numLocalElements != L0) {
908 localChecks[0] = myImageID;
911 else if (numGlobalElements < GST1 && numGlobalElements != GST0 && numGlobalElements != GSTI) {
913 localChecks[0] = myImageID;
916 else if (numGlobalElements != GSTI && numGlobalElements != global_sum) {
918 localChecks[0] = myImageID;
923 Teuchos::broadcast<int,GlobalOrdinal>(*comm,0,&rootIB);
924 if (indexBase != rootIB) {
925 localChecks[0] = myImageID;
930 Teuchos::reduceAll<int,int>(*comm,Teuchos::REDUCE_MAX,2,localChecks,globalChecks);
931 if (globalChecks[0] != -1) {
932 if (globalChecks[1] == 1) {
933 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
934 errPrefix <<
"numLocal is not valid on at least one node (possibly node "
935 << globalChecks[0] <<
").");
937 else if (globalChecks[1] == 2) {
938 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
939 errPrefix <<
"numGlobal is not valid on at least one node (possibly node "
940 << globalChecks[0] <<
").");
942 else if (globalChecks[1] == 3) {
943 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
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) {
949 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
950 errPrefix <<
"indexBase is not the same on all nodes (examine node "
951 << globalChecks[0] <<
").");
955 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::logic_error,
956 errPrefix <<
"logic error. Please contact the Tpetra team.");
963 if (numGlobalElements == GSTI) {
964 numGlobalElements = global_sum;}
971 const Teuchos::ArrayView< const GlobalOrdinal > &elementList,
973 const Teuchos::RCP<
const Teuchos::Comm< int > > &comm,
974 const Teuchos::RCP< Node > &node = Teuchos::rcp(
new Node)) {
975 if (numGlobalElements == Teuchos::OrdinalTraits<global_size_t>::invalid()) {
1018 LookupStatus getRemoteIndexList(
const Teuchos::ArrayView< const GlobalOrdinal > &GIDList,
const Teuchos::ArrayView< int > &nodeIDList,
const Teuchos::ArrayView< LocalOrdinal > &LIDList)
const {
XPETRA_MONITOR(
"EpetraMapT::getRemoteIndexList");
return toXpetra(
map_->RemoteIDList(GIDList.size(), GIDList.getRawPtr(), nodeIDList.getRawPtr(), LIDList.getRawPtr())); }
1021 LookupStatus getRemoteIndexList(
const Teuchos::ArrayView< const GlobalOrdinal > &GIDList,
const Teuchos::ArrayView< int > &nodeIDList)
const {
XPETRA_MONITOR(
"EpetraMapT::getRemoteIndexList");
return toXpetra(
map_->RemoteIDList(GIDList.size(), GIDList.getRawPtr(), nodeIDList.getRawPtr(), 0)); }
1059 return Teuchos::rcp (
new Node);
1072 std::ostringstream oss;
1073 oss << Teuchos::Describable::description();
1083 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default)
const {
1086 const Teuchos::RCP<const Teuchos::Comm<int> > comm_ =
getComm();
1091 using Teuchos::VERB_DEFAULT;
1092 using Teuchos::VERB_NONE;
1093 using Teuchos::VERB_LOW;
1094 using Teuchos::VERB_MEDIUM;
1095 using Teuchos::VERB_HIGH;
1096 using Teuchos::VERB_EXTREME;
1100 int myImageID = comm_->getRank();
1101 int numImages = comm_->getSize();
1103 Teuchos::EVerbosityLevel vl = verbLevel;
1104 if (vl == VERB_DEFAULT) vl = VERB_LOW;
1110 width = ::std::max<size_t>(width, (
size_t) 12) + 2;
1112 Teuchos::OSTab tab(out);
1114 if (vl == VERB_NONE) {
1117 else if (vl == VERB_LOW) {
1121 for (
int imageCtr = 0; imageCtr < numImages; ++imageCtr) {
1122 if (myImageID == imageCtr) {
1123 if (myImageID == 0) {
1131 if (vl == VERB_HIGH || vl == VERB_EXTREME) {
1132 out <<
"Number of Local Elements = " << nME << endl
1137 if (vl == VERB_EXTREME) {
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]
1166 const Epetra_BlockMap * NewMap =
map_->RemoveEmptyProcesses();
1168 return Teuchos::null;
1170 const RCP< const Map<int, GlobalOrdinal, Node> > NewMapX = toXpetra<GlobalOrdinal, Node>(*NewMap);
1177 RCP<const Map<int,GlobalOrdinal,Node> >
replaceCommWithSubset(
const Teuchos::RCP<
const Teuchos::Comm< int > > &newComm)
const {
1178 throw std::runtime_error(
"Xpetra::EpetraMapT::replaceCommWithSubset has not yet been implemented.");
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;
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;
1234 size_t numLocalElements =
map_->NumMyElements();
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