10#ifndef TPETRA_DIRECTORYIMPL_DEF_HPP
11#define TPETRA_DIRECTORYIMPL_DEF_HPP
16#include "Teuchos_TestForException.hpp"
17#include "Tpetra_Distributor.hpp"
18#include "Tpetra_Map.hpp"
21#include "Tpetra_Details_FixedHashTable.hpp"
22#include "Teuchos_Comm.hpp"
27#ifdef HAVE_TPETRACORE_MPI
34template <
class LO,
class GO,
class NT>
38 const Teuchos::ArrayView<const GO>&
globalIDs,
39 const Teuchos::ArrayView<int>&
nodeIDs,
40 const Teuchos::ArrayView<LO>&
localIDs,
45 std::invalid_argument, Teuchos::typeName(*
this) <<
"::getEntries(): "
46 "Output arrays do not have the right sizes. nodeIDs.size() = "
50 std::invalid_argument, Teuchos::typeName(*
this) <<
"::getEntries(): "
51 "Output array do not have the right sizes. localIDs.size() = "
62 Teuchos::OrdinalTraits<LO>::invalid());
68template <
class LO,
class GO,
class NT>
71 : numProcs_(
map.getComm()->getSize()) {}
73template <
class LO,
class GO,
class NT>
79 return (numProcs_ == 1);
82template <
class LO,
class GO,
class NT>
85 std::ostringstream
os;
86 os <<
"ReplicatedDirectory"
87 <<
"<" << Teuchos::TypeNameTraits<LO>::name()
88 <<
", " << Teuchos::TypeNameTraits<GO>::name()
89 <<
", " << Teuchos::TypeNameTraits<NT>::name() <<
">";
93template <
class LO,
class GO,
class NT>
97 Teuchos::typeName(*
this) <<
" constructor: Map is not contiguous.");
99 Teuchos::typeName(*
this) <<
" constructor: Map is not uniform.");
102template <
class LO,
class GO,
class NT>
105 std::ostringstream
os;
106 os <<
"ContiguousUniformDirectory"
107 <<
"<" << Teuchos::TypeNameTraits<LO>::name()
108 <<
", " << Teuchos::TypeNameTraits<GO>::name()
109 <<
", " << Teuchos::TypeNameTraits<NT>::name() <<
">";
113template <
class LO,
class GO,
class NT>
117 const Teuchos::ArrayView<const GO>&
globalIDs,
118 const Teuchos::ArrayView<int>&
nodeIDs,
119 const Teuchos::ArrayView<LO>&
localIDs,
123 typedef typename Teuchos::ArrayView<const GO>::size_type size_type;
124 const LO
invalidLid = Teuchos::OrdinalTraits<LO>::invalid();
128 const GO
g_min =
map.getMinAllGlobalIndex();
151 const size_type
N_G =
152 static_cast<size_type
>(
map.getGlobalNumElements());
153 const size_type
P =
static_cast<size_type
>(comm->getSize());
156 const size_type
N_R =
R * (
N_L +
static_cast<size_type
>(1));
158#ifdef HAVE_TPETRA_DEBUG
160 N_G !=
P *
N_L +
R, std::logic_error,
161 "Tpetra::ContiguousUniformDirectory::getEntriesImpl: "
163 <<
N_G <<
" != P*N_L + R = " <<
P <<
"*" <<
N_L <<
" + " <<
R
164 <<
" = " <<
P *
N_L +
R <<
". "
165 "Please report this bug to the Tpetra developers.");
171 const GO
ONE =
static_cast<GO
>(1);
185 }
else if (
g_0 <
static_cast<GO
>(
N_R)) {
189 }
else if (
g_0 >=
static_cast<GO
>(
N_R)) {
191 const GO
g_R =
g_0 -
static_cast<GO
>(
N_R);
195#ifdef HAVE_TPETRA_DEBUG
198 "Tpetra::ContiguousUniformDirectory::getEntriesImpl: "
199 "should never get here. "
200 "Please report this bug to the Tpetra developers.");
214 }
else if (
g_0 <
static_cast<GO
>(
N_R)) {
217 }
else if (
g_0 >=
static_cast<GO
>(
N_R)) {
219 const GO
g_R =
g_0 -
static_cast<GO
>(
N_R);
222#ifdef HAVE_TPETRA_DEBUG
225 "Tpetra::ContiguousUniformDirectory::getEntriesImpl: "
226 "should never get here. "
227 "Please report this bug to the Tpetra developers.");
235template <
class LO,
class GO,
class NT>
239 using Teuchos::gatherAll;
245 Teuchos::typeName(*
this) <<
" constructor: Map is not distributed.");
247 Teuchos::typeName(*
this) <<
" constructor: Map is not contiguous.");
249 const int numProcs = comm->getSize();
266#ifdef HAVE_TPETRACORE_MPI
269 if (
typeid(GO) ==
typeid(
int)) {
271 }
else if (
typeid(GO) ==
typeid(
long)) {
277 using Teuchos::MpiComm;
278 using Teuchos::rcp_dynamic_cast;
279 RCP<const MpiComm<int> > mpiComm =
280 rcp_dynamic_cast<const MpiComm<int> >(comm);
283 if (!comm.is_null()) {
284 MPI_Comm rawMpiComm = *(mpiComm->getRawMpiComm());
286 MPI_Allgather(&minMyGID, 1, rawMpiType,
287 allMinGIDs_.getRawPtr(), 1, rawMpiType,
289 TEUCHOS_TEST_FOR_EXCEPTION(err != MPI_SUCCESS, std::runtime_error,
290 "Tpetra::DistributedContiguousDirectory: MPI_Allgather failed");
292 gatherAll<int, GO>(*comm, 1, &minMyGID, numProcs, allMinGIDs_.getRawPtr());
295 gatherAll<int, GO>(*comm, 1, &minMyGID, numProcs, allMinGIDs_.getRawPtr());
298 gatherAll<int, GO>(*comm, 1, &minMyGID, numProcs, allMinGIDs_.getRawPtr());
306 allMinGIDs_[numProcs] = map.getMaxAllGlobalIndex() + Teuchos::OrdinalTraits<GO>::one();
309template <
class LO,
class GO,
class NT>
312 std::ostringstream
os;
313 os <<
"DistributedContiguousDirectory"
314 <<
"<" << Teuchos::TypeNameTraits<LO>::name()
315 <<
", " << Teuchos::TypeNameTraits<GO>::name()
316 <<
", " << Teuchos::TypeNameTraits<NT>::name() <<
">";
320template <
class LO,
class GO,
class NT>
324 const Teuchos::ArrayView<const GO>&
globalIDs,
325 const Teuchos::ArrayView<int>&
nodeIDs,
326 const Teuchos::ArrayView<LO>&
localIDs,
328 using Teuchos::Array;
329 using Teuchos::ArrayRCP;
330 using Teuchos::ArrayView;
337 const int myRank = comm->getRank();
361template <
class LO,
class GO,
class NT>
365 const Teuchos::ArrayView<const GO>&
globalIDs,
366 const Teuchos::ArrayView<int>&
nodeIDs,
367 const Teuchos::ArrayView<LO>&
localIDs,
369 using Teuchos::Array;
370 using Teuchos::ArrayRCP;
371 using Teuchos::ArrayView;
377 const int numProcs = comm->getSize();
378 const LO
LINVALID = Teuchos::OrdinalTraits<LO>::invalid();
441 while (GID >= allMinGIDs_[
above]) {
467template <
class LO,
class GO,
class NT>
470 : oneToOneResult_(ONE_TO_ONE_NOT_CALLED_YET)
472 locallyOneToOne_(
true)
474 useHashTables_(
false)
479template <
class LO,
class GO,
class NT>
480DistributedNoncontiguousDirectory<LO, GO, NT>::
481 DistributedNoncontiguousDirectory(
const map_type&
map,
483 : oneToOneResult_(ONE_TO_ONE_NOT_CALLED_YET)
485 locallyOneToOne_(
true)
487 useHashTables_(
false)
492template <
class LO,
class GO,
class NT>
493void DistributedNoncontiguousDirectory<LO, GO, NT>::
494 initialize(
const map_type& map,
495 Teuchos::Ptr<const tie_break_type> tie_break) {
499 using Teuchos::Array;
500 using Teuchos::ArrayRCP;
501 using Teuchos::ArrayView;
505 using Teuchos::typeName;
506 using Teuchos::TypeNameTraits;
507 typedef Array<int>::size_type size_type;
517 TEUCHOS_TEST_FOR_EXCEPTION(
sizeof(
global_size_t) <
sizeof(GO),
518 std::logic_error, typeName(*
this) <<
": sizeof(Tpetra::"
522 << TypeNameTraits<LO>::name() <<
") = " <<
sizeof(GO) <<
".");
523 TEUCHOS_TEST_FOR_EXCEPTION(
sizeof(
global_size_t) <
sizeof(
int),
524 std::logic_error, typeName(*
this) <<
": sizeof(Tpetra::"
526 <<
sizeof(
global_size_t) <<
" < sizeof(int) = " <<
sizeof(
int) <<
".");
527 TEUCHOS_TEST_FOR_EXCEPTION(
sizeof(
global_size_t) <
sizeof(LO),
528 std::logic_error, typeName(*
this) <<
": sizeof(Tpetra::"
532 << TypeNameTraits<LO>::name() <<
") = " <<
sizeof(LO) <<
".");
533 TEUCHOS_TEST_FOR_EXCEPTION(!map.haveGlobalConstants(), std::logic_error,
"Map needs to have global constants.");
535 RCP<const Teuchos::Comm<int> > comm = map.getComm();
536 const LO LINVALID = Teuchos::OrdinalTraits<LO>::invalid();
537 const GO minAllGID = map.getMinAllGlobalIndex();
538 const GO maxAllGID = map.getMaxAllGlobalIndex();
545 const global_size_t numGlobalEntries = maxAllGID - minAllGID + 1;
555 directoryMap_ = rcp(
new map_type(numGlobalEntries, minAllGID, comm,
556 GloballyDistributed));
558 const size_t dir_numMyEntries = directoryMap_->getLocalNumElements();
582 const size_t inverseSparsityThreshold = 10;
584 (dir_numMyEntries >= inverseSparsityThreshold * map.getLocalNumElements());
589 const int myRank = comm->getRank();
590 const size_t numMyEntries = map.getLocalNumElements();
591 Array<int> sendImageIDs(numMyEntries);
592 ArrayView<const GO> myGlobalEntries = map.getLocalElementList();
597 directoryMap_->getRemoteIndexList(myGlobalEntries, sendImageIDs);
598 TEUCHOS_TEST_FOR_EXCEPTION(
599 lookupStatus ==
IDNotPresent, std::logic_error, Teuchos::typeName(*
this) <<
" constructor: the Directory Map could not find out where one or "
600 "more of my Map's indices should go. The input to getRemoteIndexList "
602 << Teuchos::toString(myGlobalEntries) <<
", and the output is " << Teuchos::toString(sendImageIDs()) <<
". The input Map itself has "
603 "the following entries on the calling process "
604 << 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 "
606 << directoryMap_->getMinAllGlobalIndex() <<
"," << directoryMap_->getMaxAllGlobalIndex() <<
"], and the calling process "
608 << directoryMap_->getMinGlobalIndex() <<
"," << directoryMap_->getMaxGlobalIndex() <<
"]. "
609 "This probably means there is a bug in Map or Directory. "
610 "Please report this bug to the Tpetra developers.");
617 Distributor distor(comm);
618 const size_t numReceives = distor.createFromSends(sendImageIDs);
632 const int packetSize = 3;
633 Kokkos::View<GO*, Kokkos::HostSpace> exportEntries(
"exportEntries", packetSize * numMyEntries);
635 size_t exportIndex = 0;
636 for (
size_t i = 0; i < numMyEntries; ++i) {
637 exportEntries[exportIndex++] = myGlobalEntries[i];
638 exportEntries[exportIndex++] = as<GO>(myRank);
639 exportEntries[exportIndex++] = as<GO>(i);
645 Kokkos::View<GO*, Kokkos::HostSpace> importElements(
"importElements", packetSize * distor.getTotalReceiveLength());
648 distor.doPostsAndWaits(exportEntries, packetSize, importElements);
655 if (useHashTables_) {
670 LO* tableKeysRaw = NULL;
671 LO* tableLidsRaw = NULL;
672 int* tablePidsRaw = NULL;
674 tableKeysRaw =
new LO[numReceives];
675 tableLidsRaw =
new LO[numReceives];
676 tablePidsRaw =
new int[numReceives];
678 if (tableKeysRaw != NULL) {
679 delete[] tableKeysRaw;
681 if (tableLidsRaw != NULL) {
682 delete[] tableLidsRaw;
684 if (tablePidsRaw != NULL) {
685 delete[] tablePidsRaw;
689 ArrayRCP<LO> tableKeys(tableKeysRaw, 0, numReceives,
true);
690 ArrayRCP<LO> tableLids(tableLidsRaw, 0, numReceives,
true);
691 ArrayRCP<int> tablePids(tablePidsRaw, 0, numReceives,
true);
693 if (tie_break.is_null()) {
695 size_type importIndex = 0;
696 for (size_type i = 0; i < static_cast<size_type>(numReceives); ++i) {
697 const GO curGID = importElements[importIndex++];
698 const LO curLID = directoryMap_->getLocalElement(curGID);
699 TEUCHOS_TEST_FOR_EXCEPTION(
700 curLID == LINVALID, std::logic_error,
701 Teuchos::typeName(*
this) <<
" constructor: Incoming global index "
702 << curGID <<
" does not have a corresponding local index in the "
703 "Directory Map. Please report this bug to the Tpetra developers.");
704 tableKeys[i] = curLID;
705 tablePids[i] = importElements[importIndex++];
706 tableLids[i] = importElements[importIndex++];
712 rcp(
new lidToPidTable_type(tableKeys(), tablePids()));
713 locallyOneToOne_ = !(lidToPidTable_->hasDuplicateKeys());
715 rcp(
new lidToLidTable_type(tableKeys(), tableLids()));
723 typedef std::map<LO, std::vector<std::pair<int, LO> > > pair_table_type;
724 pair_table_type ownedPidLidPairs;
728 size_type importIndex = 0;
729 for (size_type i = 0; i < static_cast<size_type>(numReceives); ++i) {
730 const GO curGID = importElements[importIndex++];
731 const LO dirMapLid = directoryMap_->getLocalElement(curGID);
732 TEUCHOS_TEST_FOR_EXCEPTION(
733 dirMapLid == LINVALID, std::logic_error,
734 Teuchos::typeName(*
this) <<
" constructor: Incoming global index "
735 << curGID <<
" does not have a corresponding local index in the "
736 "Directory Map. Please report this bug to the Tpetra developers.");
737 tableKeys[i] = dirMapLid;
738 const int PID = importElements[importIndex++];
739 const int LID = importElements[importIndex++];
749 ownedPidLidPairs[dirMapLid].push_back(std::make_pair(PID, LID));
762 for (size_type i = 0; i < static_cast<size_type>(numReceives); ++i) {
763 const LO dirMapLid = tableKeys[i];
764 const std::vector<std::pair<int, LO> >& pidLidList =
765 ownedPidLidPairs[dirMapLid];
766 const size_t listLen = pidLidList.size();
767 if (listLen == 0)
continue;
768 const GO dirMapGid = directoryMap_->getGlobalElement(dirMapLid);
770 locallyOneToOne_ =
false;
779 const size_type index =
780 static_cast<size_type
>(tie_break->selectedIndex(dirMapGid,
782 tablePids[i] = pidLidList[index].first;
783 tableLids[i] = pidLidList[index].second;
788 rcp(
new lidToPidTable_type(tableKeys(), tablePids()));
790 rcp(
new lidToLidTable_type(tableKeys(), tableLids()));
793 if (tie_break.is_null()) {
798 PIDs_ = arcp<int>(dir_numMyEntries);
799 std::fill(PIDs_.begin(), PIDs_.end(), -1);
800 LIDs_ = arcp<LO>(dir_numMyEntries);
801 std::fill(LIDs_.begin(), LIDs_.end(), LINVALID);
803 size_type importIndex = 0;
804 for (size_type i = 0; i < static_cast<size_type>(numReceives); ++i) {
805 const GO curGID = importElements[importIndex++];
806 const LO curLID = directoryMap_->getLocalElement(curGID);
807 TEUCHOS_TEST_FOR_EXCEPTION(curLID == LINVALID, std::logic_error,
808 Teuchos::typeName(*
this) <<
" constructor: Incoming global index "
809 << curGID <<
" does not have a corresponding local index in the "
810 "Directory Map. Please report this bug to the Tpetra developers.");
815 if (PIDs_[curLID] != -1) {
816 locallyOneToOne_ =
false;
818 PIDs_[curLID] = importElements[importIndex++];
819 LIDs_[curLID] = importElements[importIndex++];
822 PIDs_ = arcp<int>(dir_numMyEntries);
823 LIDs_ = arcp<LO>(dir_numMyEntries);
824 std::fill(PIDs_.begin(), PIDs_.end(), -1);
833 Array<std::vector<std::pair<int, LO> > > ownedPidLidPairs(dir_numMyEntries);
834 size_t importIndex = 0;
835 for (
size_t i = 0; i < numReceives; ++i) {
836 const GO GID = importElements[importIndex++];
837 const int PID = importElements[importIndex++];
838 const LO LID = importElements[importIndex++];
840 const LO dirMapLid = directoryMap_->getLocalElement(GID);
841 TEUCHOS_TEST_FOR_EXCEPTION(
842 dirMapLid == LINVALID, std::logic_error,
843 Teuchos::typeName(*
this) <<
" constructor: Incoming global index "
844 << GID <<
" does not have a corresponding local index in the "
845 "Directory Map. Please report this bug to the Tpetra developers.");
846 ownedPidLidPairs[dirMapLid].push_back(std::make_pair(PID, LID));
858 for (
size_t i = 0; i < dir_numMyEntries; ++i) {
859 const std::vector<std::pair<int, LO> >& pidLidList =
861 const size_t listLen = pidLidList.size();
862 if (listLen == 0)
continue;
864 const LO dirMapLid =
static_cast<LO
>(i);
865 const GO dirMapGid = directoryMap_->getGlobalElement(dirMapLid);
867 locallyOneToOne_ =
false;
876 const size_type index =
877 static_cast<size_type
>(tie_break->selectedIndex(dirMapGid,
879 PIDs_[i] = pidLidList[index].first;
880 LIDs_[i] = pidLidList[index].second;
886template <
class LO,
class GO,
class NT>
889 std::ostringstream
os;
890 os <<
"DistributedNoncontiguousDirectory"
891 <<
"<" << Teuchos::TypeNameTraits<LO>::name()
892 <<
", " << Teuchos::TypeNameTraits<GO>::name()
893 <<
", " << Teuchos::TypeNameTraits<NT>::name() <<
">";
897template <
class LO,
class GO,
class NT>
901 const Teuchos::ArrayView<const GO>&
globalIDs,
902 const Teuchos::ArrayView<int>&
nodeIDs,
903 const Teuchos::ArrayView<LO>&
localIDs,
909 using Teuchos::Array;
910 using Teuchos::ArrayRCP;
911 using Teuchos::ArrayView;
914 using Teuchos::toString;
918 "DistributedNoncontiguousDirectory::getEntriesImpl: ";
920 " Please report this bug to the Tpetra developers.";
929 std::ostringstream
os;
931 if (
map.getComm().is_null()) {
934 os <<
map.getComm()->getRank();
938 new std::string(
os.str()));
945 os <<
", computeLIDs: "
950 const size_t numEntries =
globalIDs.size();
951 const LO
LINVALID = Teuchos::OrdinalTraits<LO>::invalid();
968 std::ostringstream
os;
969 os << *
procPrefix <<
"Call directoryMap_->getRemoteIndexList"
975 std::ostringstream
os;
976 os << *
procPrefix <<
"Director Map getRemoteIndexList out ";
985 for (
size_t i = 0;
i < numEntries; ++
i) {
999 std::ostringstream
os;
1000 os << *
procPrefix <<
"Call Distributor::createFromRecvs"
1006 std::ostringstream
os;
1007 os << *
procPrefix <<
"Distributor::createFromRecvs result: "
1048 Kokkos::View<global_size_t*, Kokkos::HostSpace> exports(
"exports",
packetSize *
numSends);
1063 if (useHashTables_) {
1065 std::ostringstream
os;
1066 os << *
procPrefix <<
"Pack exports (useHashTables_ true)"
1074 const LO
curLID = directoryMap_->getLocalElement(
curGID);
1076 "a corresponding local index."
1089 std::ostringstream
os;
1090 os << *
procPrefix <<
"Pack exports (useHashTables_ false)"
1098 const LO
curLID = directoryMap_->getLocalElement(
curGID);
1100 "a corresponding local index."
1114 funcPrefix <<
"On Process " << comm->getRank() <<
", "
1131 const int myRank = comm->getRank();
1134 "Tpetra::Details::DistributedNoncontiguousDirectory::getEntriesImpl: "
1136 << myRank <<
": The 'imports' array must have length "
1139 <<
distor.getTotalReceiveLength() <<
". " << std::endl
1140 <<
"Distributor description: " <<
distor.description() <<
". "
1142 <<
"Please report this bug to the Tpetra developers.");
1145 Kokkos::View<global_size_t*, Kokkos::HostSpace> imports(
"imports",
packetSize *
distor.getTotalReceiveLength());
1150 std::ostringstream
os;
1159 std::ostringstream
os;
1173 std::ostringstream
os;
1191 if (
p1.first !=
p1.second) {
1206 std::logic_error,
funcPrefix <<
"On Process " << comm->getRank() <<
": importsIndex = " <<
importsIndex <<
" > imports.size() = " << imports.size() <<
". "
1209 "numEntries (# GIDs): "
1210 << numEntries <<
", numMissing: " <<
numMissing <<
": distor.getTotalReceiveLength(): " <<
distor.getTotalReceiveLength() <<
"." <<
errSuffix);
1212 std::ostringstream
os;
1219template <
class LO,
class GO,
class NT>
1221 isOneToOne(
const Teuchos::Comm<int>& comm)
const {
1222 if (oneToOneResult_ == ONE_TO_ONE_NOT_CALLED_YET) {
1223 const int lcl121 = isLocallyOneToOne() ? 1 : 0;
1225 Teuchos::reduceAll<int, int>(comm, Teuchos::REDUCE_MIN,
lcl121,
1226 Teuchos::outArg(
gbl121));
1227 oneToOneResult_ = (
gbl121 == 1) ? ONE_TO_ONE_TRUE : ONE_TO_ONE_FALSE;
1229 return (oneToOneResult_ == ONE_TO_ONE_TRUE);
1239#define TPETRA_DIRECTORYIMPL_INSTANT(LO, GO, NODE) \
1240 namespace Details { \
1241 template class Directory<LO, GO, NODE>; \
1242 template class ReplicatedDirectory<LO, GO, NODE>; \
1243 template class ContiguousUniformDirectory<LO, GO, NODE>; \
1244 template class DistributedContiguousDirectory<LO, GO, NODE>; \
1245 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.