10#ifndef TPETRA_DIRECTORYIMPL_DEF_HPP
11#define TPETRA_DIRECTORYIMPL_DEF_HPP
16#include "Tpetra_Distributor.hpp"
17#include "Tpetra_Map.hpp"
20#include "Tpetra_Details_FixedHashTable.hpp"
21#include "Teuchos_Comm.hpp"
26#ifdef HAVE_TPETRACORE_MPI
33template <
class LO,
class GO,
class NT>
37 const Teuchos::ArrayView<const GO>&
globalIDs,
38 const Teuchos::ArrayView<int>&
nodeIDs,
39 const Teuchos::ArrayView<LO>&
localIDs,
44 std::invalid_argument, Teuchos::typeName(*
this) <<
"::getEntries(): "
45 "Output arrays do not have the right sizes. nodeIDs.size() = "
49 std::invalid_argument, Teuchos::typeName(*
this) <<
"::getEntries(): "
50 "Output array do not have the right sizes. localIDs.size() = "
61 Teuchos::OrdinalTraits<LO>::invalid());
67template <
class LO,
class GO,
class NT>
70 : numProcs_(
map.getComm()->getSize()) {}
72template <
class LO,
class GO,
class NT>
78 return (numProcs_ == 1);
81template <
class LO,
class GO,
class NT>
84 std::ostringstream
os;
85 os <<
"ReplicatedDirectory"
86 <<
"<" << Teuchos::TypeNameTraits<LO>::name()
87 <<
", " << Teuchos::TypeNameTraits<GO>::name()
88 <<
", " << Teuchos::TypeNameTraits<NT>::name() <<
">";
92template <
class LO,
class GO,
class NT>
96 Teuchos::typeName(*
this) <<
" constructor: Map is not contiguous.");
98 Teuchos::typeName(*
this) <<
" constructor: Map is not uniform.");
101template <
class LO,
class GO,
class NT>
104 std::ostringstream
os;
105 os <<
"ContiguousUniformDirectory"
106 <<
"<" << Teuchos::TypeNameTraits<LO>::name()
107 <<
", " << Teuchos::TypeNameTraits<GO>::name()
108 <<
", " << Teuchos::TypeNameTraits<NT>::name() <<
">";
112template <
class LO,
class GO,
class NT>
116 const Teuchos::ArrayView<const GO>&
globalIDs,
117 const Teuchos::ArrayView<int>&
nodeIDs,
118 const Teuchos::ArrayView<LO>&
localIDs,
122 typedef typename Teuchos::ArrayView<const GO>::size_type size_type;
123 const LO
invalidLid = Teuchos::OrdinalTraits<LO>::invalid();
127 const GO
g_min =
map.getMinAllGlobalIndex();
150 const size_type
N_G =
151 static_cast<size_type
>(
map.getGlobalNumElements());
152 const size_type
P =
static_cast<size_type
>(comm->getSize());
155 const size_type
N_R =
R * (
N_L +
static_cast<size_type
>(1));
157#ifdef HAVE_TPETRA_DEBUG
159 N_G !=
P *
N_L +
R, std::logic_error,
160 "Tpetra::ContiguousUniformDirectory::getEntriesImpl: "
162 <<
N_G <<
" != P*N_L + R = " <<
P <<
"*" <<
N_L <<
" + " <<
R
163 <<
" = " <<
P *
N_L +
R <<
". "
164 "Please report this bug to the Tpetra developers.");
170 const GO
ONE =
static_cast<GO
>(1);
184 }
else if (
g_0 <
static_cast<GO
>(
N_R)) {
188 }
else if (
g_0 >=
static_cast<GO
>(
N_R)) {
190 const GO
g_R =
g_0 -
static_cast<GO
>(
N_R);
194#ifdef HAVE_TPETRA_DEBUG
197 "Tpetra::ContiguousUniformDirectory::getEntriesImpl: "
198 "should never get here. "
199 "Please report this bug to the Tpetra developers.");
213 }
else if (
g_0 <
static_cast<GO
>(
N_R)) {
216 }
else if (
g_0 >=
static_cast<GO
>(
N_R)) {
218 const GO
g_R =
g_0 -
static_cast<GO
>(
N_R);
221#ifdef HAVE_TPETRA_DEBUG
224 "Tpetra::ContiguousUniformDirectory::getEntriesImpl: "
225 "should never get here. "
226 "Please report this bug to the Tpetra developers.");
234template <
class LO,
class GO,
class NT>
238 using Teuchos::gatherAll;
244 Teuchos::typeName(*
this) <<
" constructor: Map is not distributed.");
246 Teuchos::typeName(*
this) <<
" constructor: Map is not contiguous.");
248 const int numProcs = comm->getSize();
265#ifdef HAVE_TPETRACORE_MPI
268 if (
typeid(GO) ==
typeid(
int)) {
270 }
else if (
typeid(GO) ==
typeid(
long)) {
276 using Teuchos::MpiComm;
277 using Teuchos::rcp_dynamic_cast;
278 RCP<const MpiComm<int> > mpiComm =
279 rcp_dynamic_cast<const MpiComm<int> >(comm);
282 if (!comm.is_null()) {
283 MPI_Comm rawMpiComm = *(mpiComm->getRawMpiComm());
285 MPI_Allgather(&minMyGID, 1, rawMpiType,
286 allMinGIDs_.getRawPtr(), 1, rawMpiType,
288 TEUCHOS_TEST_FOR_EXCEPTION(err != MPI_SUCCESS, std::runtime_error,
289 "Tpetra::DistributedContiguousDirectory: MPI_Allgather failed");
291 gatherAll<int, GO>(*comm, 1, &minMyGID, numProcs, allMinGIDs_.getRawPtr());
294 gatherAll<int, GO>(*comm, 1, &minMyGID, numProcs, allMinGIDs_.getRawPtr());
297 gatherAll<int, GO>(*comm, 1, &minMyGID, numProcs, allMinGIDs_.getRawPtr());
305 allMinGIDs_[numProcs] = map.getMaxAllGlobalIndex() + Teuchos::OrdinalTraits<GO>::one();
308template <
class LO,
class GO,
class NT>
311 std::ostringstream
os;
312 os <<
"DistributedContiguousDirectory"
313 <<
"<" << Teuchos::TypeNameTraits<LO>::name()
314 <<
", " << Teuchos::TypeNameTraits<GO>::name()
315 <<
", " << Teuchos::TypeNameTraits<NT>::name() <<
">";
319template <
class LO,
class GO,
class NT>
323 const Teuchos::ArrayView<const GO>&
globalIDs,
324 const Teuchos::ArrayView<int>&
nodeIDs,
325 const Teuchos::ArrayView<LO>&
localIDs,
327 using Teuchos::Array;
328 using Teuchos::ArrayRCP;
329 using Teuchos::ArrayView;
336 const int myRank = comm->getRank();
360template <
class LO,
class GO,
class NT>
364 const Teuchos::ArrayView<const GO>&
globalIDs,
365 const Teuchos::ArrayView<int>&
nodeIDs,
366 const Teuchos::ArrayView<LO>&
localIDs,
368 using Teuchos::Array;
369 using Teuchos::ArrayRCP;
370 using Teuchos::ArrayView;
376 const int numProcs = comm->getSize();
377 const LO
LINVALID = Teuchos::OrdinalTraits<LO>::invalid();
440 while (GID >= allMinGIDs_[
above]) {
466template <
class LO,
class GO,
class NT>
469 : oneToOneResult_(ONE_TO_ONE_NOT_CALLED_YET)
471 locallyOneToOne_(
true)
473 useHashTables_(
false)
478template <
class LO,
class GO,
class NT>
479DistributedNoncontiguousDirectory<LO, GO, NT>::
480 DistributedNoncontiguousDirectory(
const map_type&
map,
482 : oneToOneResult_(ONE_TO_ONE_NOT_CALLED_YET)
484 locallyOneToOne_(
true)
486 useHashTables_(
false)
491template <
class LO,
class GO,
class NT>
492void DistributedNoncontiguousDirectory<LO, GO, NT>::
493 initialize(
const map_type& map,
494 Teuchos::Ptr<const tie_break_type> tie_break) {
498 using Teuchos::Array;
499 using Teuchos::ArrayRCP;
500 using Teuchos::ArrayView;
504 using Teuchos::typeName;
505 using Teuchos::TypeNameTraits;
506 typedef Array<int>::size_type size_type;
516 TEUCHOS_TEST_FOR_EXCEPTION(
sizeof(
global_size_t) <
sizeof(GO),
517 std::logic_error, typeName(*
this) <<
": sizeof(Tpetra::"
521 << TypeNameTraits<LO>::name() <<
") = " <<
sizeof(GO) <<
".");
522 TEUCHOS_TEST_FOR_EXCEPTION(
sizeof(
global_size_t) <
sizeof(
int),
523 std::logic_error, typeName(*
this) <<
": sizeof(Tpetra::"
525 <<
sizeof(
global_size_t) <<
" < sizeof(int) = " <<
sizeof(
int) <<
".");
526 TEUCHOS_TEST_FOR_EXCEPTION(
sizeof(
global_size_t) <
sizeof(LO),
527 std::logic_error, typeName(*
this) <<
": sizeof(Tpetra::"
531 << TypeNameTraits<LO>::name() <<
") = " <<
sizeof(LO) <<
".");
533 RCP<const Teuchos::Comm<int> > comm = map.getComm();
534 const LO LINVALID = Teuchos::OrdinalTraits<LO>::invalid();
535 const GO minAllGID = map.getMinAllGlobalIndex();
536 const GO maxAllGID = map.getMaxAllGlobalIndex();
543 const global_size_t numGlobalEntries = maxAllGID - minAllGID + 1;
553 directoryMap_ = rcp(
new map_type(numGlobalEntries, minAllGID, comm,
554 GloballyDistributed));
556 const size_t dir_numMyEntries = directoryMap_->getLocalNumElements();
580 const size_t inverseSparsityThreshold = 10;
582 (dir_numMyEntries >= inverseSparsityThreshold * map.getLocalNumElements());
587 const int myRank = comm->getRank();
588 const size_t numMyEntries = map.getLocalNumElements();
589 Array<int> sendImageIDs(numMyEntries);
590 ArrayView<const GO> myGlobalEntries = map.getLocalElementList();
595 directoryMap_->getRemoteIndexList(myGlobalEntries, sendImageIDs);
596 TEUCHOS_TEST_FOR_EXCEPTION(
597 lookupStatus ==
IDNotPresent, std::logic_error, Teuchos::typeName(*
this) <<
" constructor: the Directory Map could not find out where one or "
598 "more of my Map's indices should go. The input to getRemoteIndexList "
600 << Teuchos::toString(myGlobalEntries) <<
", and the output is " << Teuchos::toString(sendImageIDs()) <<
". The input Map itself has "
601 "the following entries on the calling process "
602 << map.getComm()->getRank() <<
": " << Teuchos::toString(map.getLocalElementList()) <<
", and has " << map.getGlobalNumElements() <<
" total global indices in [" << map.getMinAllGlobalIndex() <<
"," << map.getMaxAllGlobalIndex() <<
"]. The Directory Map has " << directoryMap_->getGlobalNumElements() <<
" total global indices in "
604 << directoryMap_->getMinAllGlobalIndex() <<
"," << directoryMap_->getMaxAllGlobalIndex() <<
"], and the calling process "
606 << directoryMap_->getMinGlobalIndex() <<
"," << directoryMap_->getMaxGlobalIndex() <<
"]. "
607 "This probably means there is a bug in Map or Directory. "
608 "Please report this bug to the Tpetra developers.");
615 Distributor distor(comm);
616 const size_t numReceives = distor.createFromSends(sendImageIDs);
630 const int packetSize = 3;
631 Kokkos::View<GO*, Kokkos::HostSpace> exportEntries(
"exportEntries", packetSize * numMyEntries);
633 size_t exportIndex = 0;
634 for (
size_t i = 0; i < numMyEntries; ++i) {
635 exportEntries[exportIndex++] = myGlobalEntries[i];
636 exportEntries[exportIndex++] = as<GO>(myRank);
637 exportEntries[exportIndex++] = as<GO>(i);
643 Kokkos::View<GO*, Kokkos::HostSpace> importElements(
"importElements", packetSize * distor.getTotalReceiveLength());
646 distor.doPostsAndWaits(exportEntries, packetSize, importElements);
653 if (useHashTables_) {
668 LO* tableKeysRaw = NULL;
669 LO* tableLidsRaw = NULL;
670 int* tablePidsRaw = NULL;
672 tableKeysRaw =
new LO[numReceives];
673 tableLidsRaw =
new LO[numReceives];
674 tablePidsRaw =
new int[numReceives];
676 if (tableKeysRaw != NULL) {
677 delete[] tableKeysRaw;
679 if (tableLidsRaw != NULL) {
680 delete[] tableLidsRaw;
682 if (tablePidsRaw != NULL) {
683 delete[] tablePidsRaw;
687 ArrayRCP<LO> tableKeys(tableKeysRaw, 0, numReceives,
true);
688 ArrayRCP<LO> tableLids(tableLidsRaw, 0, numReceives,
true);
689 ArrayRCP<int> tablePids(tablePidsRaw, 0, numReceives,
true);
691 if (tie_break.is_null()) {
693 size_type importIndex = 0;
694 for (size_type i = 0; i < static_cast<size_type>(numReceives); ++i) {
695 const GO curGID = importElements[importIndex++];
696 const LO curLID = directoryMap_->getLocalElement(curGID);
697 TEUCHOS_TEST_FOR_EXCEPTION(
698 curLID == LINVALID, std::logic_error,
699 Teuchos::typeName(*
this) <<
" constructor: Incoming global index "
700 << curGID <<
" does not have a corresponding local index in the "
701 "Directory Map. Please report this bug to the Tpetra developers.");
702 tableKeys[i] = curLID;
703 tablePids[i] = importElements[importIndex++];
704 tableLids[i] = importElements[importIndex++];
710 rcp(
new lidToPidTable_type(tableKeys(), tablePids()));
711 locallyOneToOne_ = !(lidToPidTable_->hasDuplicateKeys());
713 rcp(
new lidToLidTable_type(tableKeys(), tableLids()));
721 typedef std::map<LO, std::vector<std::pair<int, LO> > > pair_table_type;
722 pair_table_type ownedPidLidPairs;
726 size_type importIndex = 0;
727 for (size_type i = 0; i < static_cast<size_type>(numReceives); ++i) {
728 const GO curGID = importElements[importIndex++];
729 const LO dirMapLid = directoryMap_->getLocalElement(curGID);
730 TEUCHOS_TEST_FOR_EXCEPTION(
731 dirMapLid == LINVALID, std::logic_error,
732 Teuchos::typeName(*
this) <<
" constructor: Incoming global index "
733 << curGID <<
" does not have a corresponding local index in the "
734 "Directory Map. Please report this bug to the Tpetra developers.");
735 tableKeys[i] = dirMapLid;
736 const int PID = importElements[importIndex++];
737 const int LID = importElements[importIndex++];
747 ownedPidLidPairs[dirMapLid].push_back(std::make_pair(PID, LID));
760 for (size_type i = 0; i < static_cast<size_type>(numReceives); ++i) {
761 const LO dirMapLid = tableKeys[i];
762 const std::vector<std::pair<int, LO> >& pidLidList =
763 ownedPidLidPairs[dirMapLid];
764 const size_t listLen = pidLidList.size();
765 if (listLen == 0)
continue;
766 const GO dirMapGid = directoryMap_->getGlobalElement(dirMapLid);
768 locallyOneToOne_ =
false;
777 const size_type index =
778 static_cast<size_type
>(tie_break->selectedIndex(dirMapGid,
780 tablePids[i] = pidLidList[index].first;
781 tableLids[i] = pidLidList[index].second;
786 rcp(
new lidToPidTable_type(tableKeys(), tablePids()));
788 rcp(
new lidToLidTable_type(tableKeys(), tableLids()));
791 if (tie_break.is_null()) {
796 PIDs_ = arcp<int>(dir_numMyEntries);
797 std::fill(PIDs_.begin(), PIDs_.end(), -1);
798 LIDs_ = arcp<LO>(dir_numMyEntries);
799 std::fill(LIDs_.begin(), LIDs_.end(), LINVALID);
801 size_type importIndex = 0;
802 for (size_type i = 0; i < static_cast<size_type>(numReceives); ++i) {
803 const GO curGID = importElements[importIndex++];
804 const LO curLID = directoryMap_->getLocalElement(curGID);
805 TEUCHOS_TEST_FOR_EXCEPTION(curLID == LINVALID, std::logic_error,
806 Teuchos::typeName(*
this) <<
" constructor: Incoming global index "
807 << curGID <<
" does not have a corresponding local index in the "
808 "Directory Map. Please report this bug to the Tpetra developers.");
813 if (PIDs_[curLID] != -1) {
814 locallyOneToOne_ =
false;
816 PIDs_[curLID] = importElements[importIndex++];
817 LIDs_[curLID] = importElements[importIndex++];
820 PIDs_ = arcp<int>(dir_numMyEntries);
821 LIDs_ = arcp<LO>(dir_numMyEntries);
822 std::fill(PIDs_.begin(), PIDs_.end(), -1);
831 Array<std::vector<std::pair<int, LO> > > ownedPidLidPairs(dir_numMyEntries);
832 size_t importIndex = 0;
833 for (
size_t i = 0; i < numReceives; ++i) {
834 const GO GID = importElements[importIndex++];
835 const int PID = importElements[importIndex++];
836 const LO LID = importElements[importIndex++];
838 const LO dirMapLid = directoryMap_->getLocalElement(GID);
839 TEUCHOS_TEST_FOR_EXCEPTION(
840 dirMapLid == LINVALID, std::logic_error,
841 Teuchos::typeName(*
this) <<
" constructor: Incoming global index "
842 << GID <<
" does not have a corresponding local index in the "
843 "Directory Map. Please report this bug to the Tpetra developers.");
844 ownedPidLidPairs[dirMapLid].push_back(std::make_pair(PID, LID));
856 for (
size_t i = 0; i < dir_numMyEntries; ++i) {
857 const std::vector<std::pair<int, LO> >& pidLidList =
859 const size_t listLen = pidLidList.size();
860 if (listLen == 0)
continue;
862 const LO dirMapLid =
static_cast<LO
>(i);
863 const GO dirMapGid = directoryMap_->getGlobalElement(dirMapLid);
865 locallyOneToOne_ =
false;
874 const size_type index =
875 static_cast<size_type
>(tie_break->selectedIndex(dirMapGid,
877 PIDs_[i] = pidLidList[index].first;
878 LIDs_[i] = pidLidList[index].second;
884template <
class LO,
class GO,
class NT>
887 std::ostringstream
os;
888 os <<
"DistributedNoncontiguousDirectory"
889 <<
"<" << Teuchos::TypeNameTraits<LO>::name()
890 <<
", " << Teuchos::TypeNameTraits<GO>::name()
891 <<
", " << Teuchos::TypeNameTraits<NT>::name() <<
">";
895template <
class LO,
class GO,
class NT>
899 const Teuchos::ArrayView<const GO>&
globalIDs,
900 const Teuchos::ArrayView<int>&
nodeIDs,
901 const Teuchos::ArrayView<LO>&
localIDs,
907 using Teuchos::Array;
908 using Teuchos::ArrayRCP;
909 using Teuchos::ArrayView;
912 using Teuchos::toString;
916 "DistributedNoncontiguousDirectory::getEntriesImpl: ";
918 " Please report this bug to the Tpetra developers.";
927 std::ostringstream
os;
929 if (
map.getComm().is_null()) {
932 os <<
map.getComm()->getRank();
936 new std::string(
os.str()));
943 os <<
", computeLIDs: "
948 const size_t numEntries =
globalIDs.size();
949 const LO
LINVALID = Teuchos::OrdinalTraits<LO>::invalid();
966 std::ostringstream
os;
967 os << *
procPrefix <<
"Call directoryMap_->getRemoteIndexList"
973 std::ostringstream
os;
974 os << *
procPrefix <<
"Director Map getRemoteIndexList out ";
983 for (
size_t i = 0;
i < numEntries; ++
i) {
997 std::ostringstream
os;
998 os << *
procPrefix <<
"Call Distributor::createFromRecvs"
1004 std::ostringstream
os;
1005 os << *
procPrefix <<
"Distributor::createFromRecvs result: "
1046 Kokkos::View<global_size_t*, Kokkos::HostSpace> exports(
"exports",
packetSize *
numSends);
1061 if (useHashTables_) {
1063 std::ostringstream
os;
1064 os << *
procPrefix <<
"Pack exports (useHashTables_ true)"
1072 const LO
curLID = directoryMap_->getLocalElement(
curGID);
1074 "a corresponding local index."
1087 std::ostringstream
os;
1088 os << *
procPrefix <<
"Pack exports (useHashTables_ false)"
1096 const LO
curLID = directoryMap_->getLocalElement(
curGID);
1098 "a corresponding local index."
1112 funcPrefix <<
"On Process " << comm->getRank() <<
", "
1129 const int myRank = comm->getRank();
1132 "Tpetra::Details::DistributedNoncontiguousDirectory::getEntriesImpl: "
1134 <<
myRank <<
": The 'imports' array must have length "
1137 <<
distor.getTotalReceiveLength() <<
". " << std::endl
1138 <<
"Distributor description: " <<
distor.description() <<
". "
1140 <<
"Please report this bug to the Tpetra developers.");
1143 Kokkos::View<global_size_t*, Kokkos::HostSpace> imports(
"imports",
packetSize *
distor.getTotalReceiveLength());
1148 std::ostringstream
os;
1157 std::ostringstream
os;
1171 std::ostringstream
os;
1189 if (
p1.first !=
p1.second) {
1204 std::logic_error,
funcPrefix <<
"On Process " << comm->getRank() <<
": importsIndex = " <<
importsIndex <<
" > imports.size() = " << imports.size() <<
". "
1207 "numEntries (# GIDs): "
1208 << numEntries <<
", numMissing: " <<
numMissing <<
": distor.getTotalReceiveLength(): " <<
distor.getTotalReceiveLength() <<
"." <<
errSuffix);
1210 std::ostringstream
os;
1217template <
class LO,
class GO,
class NT>
1219 isOneToOne(
const Teuchos::Comm<int>& comm)
const {
1220 if (oneToOneResult_ == ONE_TO_ONE_NOT_CALLED_YET) {
1221 const int lcl121 = isLocallyOneToOne() ? 1 : 0;
1223 Teuchos::reduceAll<int, int>(comm, Teuchos::REDUCE_MIN,
lcl121,
1224 Teuchos::outArg(
gbl121));
1225 oneToOneResult_ = (
gbl121 == 1) ? ONE_TO_ONE_TRUE : ONE_TO_ONE_FALSE;
1227 return (oneToOneResult_ == ONE_TO_ONE_TRUE);
1237#define TPETRA_DIRECTORYIMPL_INSTANT(LO, GO, NODE) \
1238 namespace Details { \
1239 template class Directory<LO, GO, NODE>; \
1240 template class ReplicatedDirectory<LO, GO, NODE>; \
1241 template class ContiguousUniformDirectory<LO, GO, NODE>; \
1242 template class DistributedContiguousDirectory<LO, GO, NODE>; \
1243 template class DistributedNoncontiguousDirectory<LO, GO, NODE>; \
Interface for breaking ties in ownership.
Stand-alone utility functions and macros.
Struct that holds views of the contents of a CrsMatrix.
Description of Tpetra's behavior.
static bool verbose()
Whether Tpetra is in verbose mode.
static size_t verbosePrintCountThreshold()
Number of entries below which arrays, lists, etc. will be printed in debug mode.
LookupStatus getEntries(const map_type &map, const Teuchos::ArrayView< const GlobalOrdinal > &globalIDs, const Teuchos::ArrayView< int > &nodeIDs, const Teuchos::ArrayView< LocalOrdinal > &localIDs, const bool computeLIDs) const
Implementation of Directory for a distributed contiguous Map.
LookupStatus getEntriesImpl(const map_type &map, const Teuchos::ArrayView< const GlobalOrdinal > &globalIDs, const Teuchos::ArrayView< int > &nodeIDs, const Teuchos::ArrayView< LocalOrdinal > &localIDs, const bool computeLIDs) const override
Find process IDs and (optionally) local IDs for the given global IDs.
std::string description() const override
A one-line human-readable description of this object.
Implementation of Directory for a distributed noncontiguous Map.
std::string description() const override
A one-line human-readable description of this object.
bool isOneToOne(const Teuchos::Comm< int > &comm) const override
Whether the Directory's input Map is (globally) one to one.
LookupStatus getEntriesImpl(const map_type &map, const Teuchos::ArrayView< const GlobalOrdinal > &globalIDs, const Teuchos::ArrayView< int > &nodeIDs, const Teuchos::ArrayView< LocalOrdinal > &localIDs, const bool computeLIDs) const override
Find process IDs and (optionally) local IDs for the given global IDs.
LookupStatus getEntriesImpl(const map_type &map, const Teuchos::ArrayView< const GlobalOrdinal > &globalIDs, const Teuchos::ArrayView< int > &nodeIDs, const Teuchos::ArrayView< LocalOrdinal > &localIDs, const bool computeLIDs) const override
Find process IDs and (optionally) local IDs for the given global IDs.
bool isOneToOne(const Teuchos::Comm< int > &comm) const override
Whether the Directory's input Map is (globally) one to one.
std::string description() const override
A one-line human-readable description of this object.
ReplicatedDirectory()=default
Constructor (that takes no arguments).
Sets up and executes a communication plan for a Tpetra DistObject.
A parallel distribution of indices over processes.
Implementation details of Tpetra.
void verbosePrintArray(std::ostream &out, const ArrayType &x, const char name[], const size_t maxNumToPrint)
Print min(x.size(), maxNumToPrint) entries of x.
Namespace Tpetra contains the class and methods constituting the Tpetra library.
void initialize(int *argc, char ***argv)
Initialize Tpetra.
void sort2(const IT1 &first1, const IT1 &last1, const IT2 &first2, const bool stableSort=false)
Sort the first array, and apply the resulting permutation to the second array.
LookupStatus
Return status of Map remote index lookup (getRemoteIndexList()).
size_t global_size_t
Global size_t object.