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
33 template<
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,
45 std::invalid_argument, Teuchos::typeName(*
this) <<
"::getEntries(): "
46 "Output arrays do not have the right sizes. nodeIDs.size() = "
51 std::invalid_argument, Teuchos::typeName(*
this) <<
"::getEntries(): "
52 "Output array do not have the right sizes. localIDs.size() = "
64 Teuchos::OrdinalTraits<LO>::invalid ());
71 template<
class LO,
class GO,
class NT>
74 numProcs_ (
map.getComm ()->getSize ())
78 template<
class LO,
class GO,
class NT>
86 return (numProcs_ == 1);
90 template<
class LO,
class GO,
class NT>
94 std::ostringstream
os;
95 os <<
"ReplicatedDirectory"
96 <<
"<" << Teuchos::TypeNameTraits<LO>::name ()
97 <<
", " << Teuchos::TypeNameTraits<GO>::name ()
98 <<
", " << Teuchos::TypeNameTraits<NT>::name () <<
">";
103 template<
class LO,
class GO,
class NT>
108 Teuchos::typeName (*
this) <<
" constructor: Map is not contiguous.");
110 Teuchos::typeName (*
this) <<
" constructor: Map is not uniform.");
114 template<
class LO,
class GO,
class NT>
118 std::ostringstream
os;
119 os <<
"ContiguousUniformDirectory"
120 <<
"<" << Teuchos::TypeNameTraits<LO>::name ()
121 <<
", " << Teuchos::TypeNameTraits<GO>::name ()
122 <<
", " << Teuchos::TypeNameTraits<NT>::name () <<
">";
127 template<
class LO,
class GO,
class NT>
131 const Teuchos::ArrayView<const GO> &
globalIDs,
132 const Teuchos::ArrayView<int> &
nodeIDs,
133 const Teuchos::ArrayView<LO> &
localIDs,
138 typedef typename Teuchos::ArrayView<const GO>::size_type size_type;
139 const LO
invalidLid = Teuchos::OrdinalTraits<LO>::invalid ();
143 const GO
g_min =
map.getMinAllGlobalIndex ();
166 const size_type
N_G =
167 static_cast<size_type
> (
map.getGlobalNumElements ());
168 const size_type
P =
static_cast<size_type
> (comm->getSize ());
171 const size_type
N_R =
R * (
N_L +
static_cast<size_type
> (1));
173#ifdef HAVE_TPETRA_DEBUG
176 "Tpetra::ContiguousUniformDirectory::getEntriesImpl: "
177 "N_G = " <<
N_G <<
" != P*N_L + R = " <<
P <<
"*" <<
N_L <<
" + " <<
R
178 <<
" = " <<
P*
N_L +
R <<
". "
179 "Please report this bug to the Tpetra developers.");
185 const GO
ONE =
static_cast<GO
> (1);
200 else if (
g_0 <
static_cast<GO
> (
N_R)) {
205 else if (
g_0 >=
static_cast<GO
> (
N_R)) {
207 const GO
g_R =
g_0 -
static_cast<GO
> (
N_R);
211#ifdef HAVE_TPETRA_DEBUG
214 "Tpetra::ContiguousUniformDirectory::getEntriesImpl: "
215 "should never get here. "
216 "Please report this bug to the Tpetra developers.");
232 else if (
g_0 <
static_cast<GO
> (
N_R)) {
236 else if (
g_0 >=
static_cast<GO
> (
N_R)) {
238 const GO
g_R =
g_0 -
static_cast<GO
> (
N_R);
241#ifdef HAVE_TPETRA_DEBUG
244 "Tpetra::ContiguousUniformDirectory::getEntriesImpl: "
245 "should never get here. "
246 "Please report this bug to the Tpetra developers.");
254 template<
class LO,
class GO,
class NT>
259 using Teuchos::gatherAll;
265 Teuchos::typeName (*
this) <<
" constructor: Map is not distributed.");
267 Teuchos::typeName (*
this) <<
" constructor: Map is not contiguous.");
269 const int numProcs = comm->getSize ();
286#ifdef HAVE_TPETRACORE_MPI
289 if (
typeid (GO) ==
typeid (
int)) {
291 }
else if (
typeid (GO) ==
typeid (
long)) {
297 using Teuchos::rcp_dynamic_cast;
298 using Teuchos::MpiComm;
299 RCP<const MpiComm<int> > mpiComm =
300 rcp_dynamic_cast<const MpiComm<int> > (comm);
303 if (! comm.is_null ()) {
304 MPI_Comm rawMpiComm = * (mpiComm->getRawMpiComm ());
306 MPI_Allgather (&minMyGID, 1, rawMpiType,
307 allMinGIDs_.getRawPtr (), 1, rawMpiType,
309 TEUCHOS_TEST_FOR_EXCEPTION(err != MPI_SUCCESS, std::runtime_error,
310 "Tpetra::DistributedContiguousDirectory: MPI_Allgather failed");
312 gatherAll<int, GO> (*comm, 1, &minMyGID, numProcs, allMinGIDs_.getRawPtr ());
315 gatherAll<int, GO> (*comm, 1, &minMyGID, numProcs, allMinGIDs_.getRawPtr ());
318 gatherAll<int, GO> (*comm, 1, &minMyGID, numProcs, allMinGIDs_.getRawPtr ());
326 allMinGIDs_[numProcs] = map.getMaxAllGlobalIndex ()
327 + Teuchos::OrdinalTraits<GO>::one ();
330 template<
class LO,
class GO,
class NT>
334 std::ostringstream
os;
335 os <<
"DistributedContiguousDirectory"
336 <<
"<" << Teuchos::TypeNameTraits<LO>::name ()
337 <<
", " << Teuchos::TypeNameTraits<GO>::name ()
338 <<
", " << Teuchos::TypeNameTraits<NT>::name () <<
">";
342 template<
class LO,
class GO,
class NT>
346 const Teuchos::ArrayView<const GO> &
globalIDs,
347 const Teuchos::ArrayView<int> &
nodeIDs,
348 const Teuchos::ArrayView<LO> &
localIDs,
351 using Teuchos::Array;
352 using Teuchos::ArrayRCP;
353 using Teuchos::ArrayView;
360 const int myRank = comm->getRank ();
385 template<
class LO,
class GO,
class NT>
389 const Teuchos::ArrayView<const GO> &
globalIDs,
390 const Teuchos::ArrayView<int> &
nodeIDs,
391 const Teuchos::ArrayView<LO> &
localIDs,
394 using Teuchos::Array;
395 using Teuchos::ArrayRCP;
396 using Teuchos::ArrayView;
402 const int numProcs = comm->getSize ();
403 const LO
LINVALID = Teuchos::OrdinalTraits<LO>::invalid();
469 while (GID >= allMinGIDs_[
above]) {
496 template<
class LO,
class GO,
class NT>
499 oneToOneResult_ (ONE_TO_ONE_NOT_CALLED_YET),
500 locallyOneToOne_ (
true),
501 useHashTables_ (
false)
506 template<
class LO,
class GO,
class NT>
507 DistributedNoncontiguousDirectory<LO, GO, NT>::
508 DistributedNoncontiguousDirectory (
const map_type&
map,
510 oneToOneResult_ (ONE_TO_ONE_NOT_CALLED_YET),
511 locallyOneToOne_ (
true),
512 useHashTables_ (
false)
517 template<
class LO,
class GO,
class NT>
519 DistributedNoncontiguousDirectory<LO, GO, NT>::
520 initialize (
const map_type& map,
521 Teuchos::Ptr<const tie_break_type> tie_break)
524 using Teuchos::Array;
525 using Teuchos::ArrayRCP;
526 using Teuchos::ArrayView;
530 using Teuchos::typeName;
531 using Teuchos::TypeNameTraits;
534 typedef Array<int>::size_type size_type;
544 TEUCHOS_TEST_FOR_EXCEPTION(
sizeof(
global_size_t) <
sizeof(GO),
545 std::logic_error, typeName (*
this) <<
": sizeof(Tpetra::"
546 "global_size_t) = " <<
sizeof(
global_size_t) <<
" < sizeof(Global"
547 "Ordinal = " << TypeNameTraits<LO>::name () <<
") = " <<
sizeof(GO)
549 TEUCHOS_TEST_FOR_EXCEPTION(
sizeof(
global_size_t) <
sizeof(
int),
550 std::logic_error, typeName (*
this) <<
": sizeof(Tpetra::"
551 "global_size_t) = " <<
sizeof(
global_size_t) <<
" < sizeof(int) = "
552 <<
sizeof(
int) <<
".");
553 TEUCHOS_TEST_FOR_EXCEPTION(
sizeof(
global_size_t) <
sizeof(LO),
554 std::logic_error, typeName (*
this) <<
": sizeof(Tpetra::"
555 "global_size_t) = " <<
sizeof(
global_size_t) <<
" < sizeof(Local"
556 "Ordinal = " << TypeNameTraits<LO>::name () <<
") = " <<
sizeof(LO)
559 RCP<const Teuchos::Comm<int> > comm = map.getComm ();
560 const LO LINVALID = Teuchos::OrdinalTraits<LO>::invalid ();
561 const GO minAllGID = map.getMinAllGlobalIndex ();
562 const GO maxAllGID = map.getMaxAllGlobalIndex ();
569 const global_size_t numGlobalEntries = maxAllGID - minAllGID + 1;
579 directoryMap_ = rcp (
new map_type (numGlobalEntries, minAllGID, comm,
580 GloballyDistributed));
582 const size_t dir_numMyEntries = directoryMap_->getLocalNumElements ();
606 const size_t inverseSparsityThreshold = 10;
608 (dir_numMyEntries >= inverseSparsityThreshold * map.getLocalNumElements());
613 const int myRank = comm->getRank ();
614 const size_t numMyEntries = map.getLocalNumElements ();
615 Array<int> sendImageIDs (numMyEntries);
616 ArrayView<const GO> myGlobalEntries = map.getLocalElementList ();
621 directoryMap_->getRemoteIndexList (myGlobalEntries, sendImageIDs);
622 TEUCHOS_TEST_FOR_EXCEPTION(
623 lookupStatus ==
IDNotPresent, std::logic_error, Teuchos::typeName(*
this)
624 <<
" constructor: the Directory Map could not find out where one or "
625 "more of my Map's indices should go. The input to getRemoteIndexList "
626 "is " << Teuchos::toString (myGlobalEntries) <<
", and the output is "
627 << Teuchos::toString (sendImageIDs ()) <<
". The input Map itself has "
628 "the following entries on the calling process " <<
629 map.getComm ()->getRank () <<
": " <<
630 Teuchos::toString (map.getLocalElementList ()) <<
", and has "
631 << map.getGlobalNumElements () <<
" total global indices in ["
632 << map.getMinAllGlobalIndex () <<
"," << map.getMaxAllGlobalIndex ()
633 <<
"]. The Directory Map has "
634 << directoryMap_->getGlobalNumElements () <<
" total global indices in "
635 "[" << directoryMap_->getMinAllGlobalIndex () <<
"," <<
636 directoryMap_->getMaxAllGlobalIndex () <<
"], and the calling process "
637 "has GIDs [" << directoryMap_->getMinGlobalIndex () <<
"," <<
638 directoryMap_->getMaxGlobalIndex () <<
"]. "
639 "This probably means there is a bug in Map or Directory. "
640 "Please report this bug to the Tpetra developers.");
647 Distributor distor (comm);
648 const size_t numReceives = distor.createFromSends (sendImageIDs);
662 const int packetSize = 3;
663 Kokkos::View<GO*, Kokkos::HostSpace> exportEntries(
"exportEntries", packetSize * numMyEntries);
665 size_t exportIndex = 0;
666 for (
size_t i = 0; i < numMyEntries; ++i) {
667 exportEntries[exportIndex++] = myGlobalEntries[i];
668 exportEntries[exportIndex++] = as<GO> (myRank);
669 exportEntries[exportIndex++] = as<GO> (i);
675 Kokkos::View<GO*, Kokkos::HostSpace> importElements(
"importElements", packetSize * distor.getTotalReceiveLength());
678 distor.doPostsAndWaits(exportEntries, packetSize, importElements);
685 if (useHashTables_) {
700 LO* tableKeysRaw = NULL;
701 LO* tableLidsRaw = NULL;
702 int* tablePidsRaw = NULL;
704 tableKeysRaw =
new LO [numReceives];
705 tableLidsRaw =
new LO [numReceives];
706 tablePidsRaw =
new int [numReceives];
708 if (tableKeysRaw != NULL) {
709 delete [] tableKeysRaw;
711 if (tableLidsRaw != NULL) {
712 delete [] tableLidsRaw;
714 if (tablePidsRaw != NULL) {
715 delete [] tablePidsRaw;
719 ArrayRCP<LO> tableKeys (tableKeysRaw, 0, numReceives,
true);
720 ArrayRCP<LO> tableLids (tableLidsRaw, 0, numReceives,
true);
721 ArrayRCP<int> tablePids (tablePidsRaw, 0, numReceives,
true);
723 if (tie_break.is_null ()) {
725 size_type importIndex = 0;
726 for (size_type i = 0; i < static_cast<size_type> (numReceives); ++i) {
727 const GO curGID = importElements[importIndex++];
728 const LO curLID = directoryMap_->getLocalElement (curGID);
729 TEUCHOS_TEST_FOR_EXCEPTION(
730 curLID == LINVALID, std::logic_error,
731 Teuchos::typeName(*
this) <<
" constructor: Incoming global index "
732 << curGID <<
" does not have a corresponding local index in the "
733 "Directory Map. Please report this bug to the Tpetra developers.");
734 tableKeys[i] = curLID;
735 tablePids[i] = importElements[importIndex++];
736 tableLids[i] = importElements[importIndex++];
742 rcp (
new lidToPidTable_type (tableKeys (), tablePids ()));
743 locallyOneToOne_ = ! (lidToPidTable_->hasDuplicateKeys ());
745 rcp (
new lidToLidTable_type (tableKeys (), tableLids ()));
754 typedef std::map<LO, std::vector<std::pair<int, LO> > > pair_table_type;
755 pair_table_type ownedPidLidPairs;
759 size_type importIndex = 0;
760 for (size_type i = 0; i < static_cast<size_type> (numReceives); ++i) {
761 const GO curGID = importElements[importIndex++];
762 const LO dirMapLid = directoryMap_->getLocalElement (curGID);
763 TEUCHOS_TEST_FOR_EXCEPTION(
764 dirMapLid == LINVALID, std::logic_error,
765 Teuchos::typeName(*
this) <<
" constructor: Incoming global index "
766 << curGID <<
" does not have a corresponding local index in the "
767 "Directory Map. Please report this bug to the Tpetra developers.");
768 tableKeys[i] = dirMapLid;
769 const int PID = importElements[importIndex++];
770 const int LID = importElements[importIndex++];
780 ownedPidLidPairs[dirMapLid].push_back (std::make_pair (PID, LID));
793 for (size_type i = 0; i < static_cast<size_type> (numReceives); ++i) {
794 const LO dirMapLid = tableKeys[i];
795 const std::vector<std::pair<int, LO> >& pidLidList =
796 ownedPidLidPairs[dirMapLid];
797 const size_t listLen = pidLidList.size();
798 if (listLen == 0)
continue;
799 const GO dirMapGid = directoryMap_->getGlobalElement (dirMapLid);
801 locallyOneToOne_ =
false;
810 const size_type index =
811 static_cast<size_type
> (tie_break->selectedIndex (dirMapGid,
813 tablePids[i] = pidLidList[index].first;
814 tableLids[i] = pidLidList[index].second;
819 rcp (
new lidToPidTable_type (tableKeys (), tablePids ()));
821 rcp (
new lidToLidTable_type (tableKeys (), tableLids ()));
825 if (tie_break.is_null ()) {
830 PIDs_ = arcp<int> (dir_numMyEntries);
831 std::fill (PIDs_.begin (), PIDs_.end (), -1);
832 LIDs_ = arcp<LO> (dir_numMyEntries);
833 std::fill (LIDs_.begin (), LIDs_.end (), LINVALID);
835 size_type importIndex = 0;
836 for (size_type i = 0; i < static_cast<size_type> (numReceives); ++i) {
837 const GO curGID = importElements[importIndex++];
838 const LO curLID = directoryMap_->getLocalElement (curGID);
839 TEUCHOS_TEST_FOR_EXCEPTION(curLID == LINVALID, std::logic_error,
840 Teuchos::typeName(*
this) <<
" constructor: Incoming global index "
841 << curGID <<
" does not have a corresponding local index in the "
842 "Directory Map. Please report this bug to the Tpetra developers.");
847 if (PIDs_[curLID] != -1) {
848 locallyOneToOne_ =
false;
850 PIDs_[curLID] = importElements[importIndex++];
851 LIDs_[curLID] = importElements[importIndex++];
855 PIDs_ = arcp<int> (dir_numMyEntries);
856 LIDs_ = arcp<LO> (dir_numMyEntries);
857 std::fill (PIDs_.begin (), PIDs_.end (), -1);
866 Array<std::vector<std::pair<int, LO> > > ownedPidLidPairs (dir_numMyEntries);
867 size_t importIndex = 0;
868 for (
size_t i = 0; i < numReceives; ++i) {
869 const GO GID = importElements[importIndex++];
870 const int PID = importElements[importIndex++];
871 const LO LID = importElements[importIndex++];
873 const LO dirMapLid = directoryMap_->getLocalElement (GID);
874 TEUCHOS_TEST_FOR_EXCEPTION(
875 dirMapLid == LINVALID, std::logic_error,
876 Teuchos::typeName(*
this) <<
" constructor: Incoming global index "
877 << GID <<
" does not have a corresponding local index in the "
878 "Directory Map. Please report this bug to the Tpetra developers.");
879 ownedPidLidPairs[dirMapLid].push_back (std::make_pair (PID, LID));
891 for (
size_t i = 0; i < dir_numMyEntries; ++i) {
892 const std::vector<std::pair<int, LO> >& pidLidList =
894 const size_t listLen = pidLidList.size();
895 if (listLen == 0)
continue;
897 const LO dirMapLid =
static_cast<LO
> (i);
898 const GO dirMapGid = directoryMap_->getGlobalElement (dirMapLid);
900 locallyOneToOne_ =
false;
909 const size_type index =
910 static_cast<size_type
> (tie_break->selectedIndex (dirMapGid,
912 PIDs_[i] = pidLidList[index].first;
913 LIDs_[i] = pidLidList[index].second;
919 template<
class LO,
class GO,
class NT>
923 std::ostringstream
os;
924 os <<
"DistributedNoncontiguousDirectory"
925 <<
"<" << Teuchos::TypeNameTraits<LO>::name ()
926 <<
", " << Teuchos::TypeNameTraits<GO>::name ()
927 <<
", " << Teuchos::TypeNameTraits<NT>::name () <<
">";
931 template<
class LO,
class GO,
class NT>
935 const Teuchos::ArrayView<const GO> &
globalIDs,
936 const Teuchos::ArrayView<int> &
nodeIDs,
937 const Teuchos::ArrayView<LO> &
localIDs,
940 using Teuchos::Array;
941 using Teuchos::ArrayRCP;
942 using Teuchos::ArrayView;
945 using Teuchos::toString;
952 "DistributedNoncontiguousDirectory::getEntriesImpl: ";
954 " Please report this bug to the Tpetra developers.";
964 std::ostringstream
os;
966 if (
map.getComm ().is_null ()) {
970 os <<
map.getComm ()->getRank ();
974 new std::string(
os.str()));
981 os <<
", computeLIDs: "
986 const size_t numEntries =
globalIDs.size ();
987 const LO
LINVALID = Teuchos::OrdinalTraits<LO>::invalid();
1004 std::ostringstream
os;
1005 os << *
procPrefix <<
"Call directoryMap_->getRemoteIndexList"
1011 std::ostringstream
os;
1012 os << *
procPrefix <<
"Director Map getRemoteIndexList out ";
1021 for (
size_t i=0;
i < numEntries; ++
i) {
1035 std::ostringstream
os;
1036 os << *
procPrefix <<
"Call Distributor::createFromRecvs"
1042 std::ostringstream
os;
1043 os << *
procPrefix <<
"Distributor::createFromRecvs result: "
1084 Kokkos::View<global_size_t*, Kokkos::HostSpace> exports(
"exports",
packetSize *
numSends);
1099 if (useHashTables_) {
1101 std::ostringstream
os;
1102 os << *
procPrefix <<
"Pack exports (useHashTables_ true)"
1110 const LO
curLID = directoryMap_->getLocalElement (
curGID);
1113 "Directory Map's global index " <<
curGID <<
" lacks "
1114 "a corresponding local index." <<
errSuffix);
1127 std::ostringstream
os;
1128 os << *
procPrefix <<
"Pack exports (useHashTables_ false)"
1136 const LO
curLID = directoryMap_->getLocalElement (
curGID);
1139 "Directory Map's global index " <<
curGID <<
" lacks "
1140 "a corresponding local index." <<
errSuffix);
1154 funcPrefix <<
"On Process " << comm->getRank () <<
", "
1155 "exportsIndex = " <<
exportsIndex <<
" > exports.size() = "
1156 << exports.size () <<
"." <<
errSuffix);
1161 "On Process " << comm->getRank () <<
", numEntries = " <<
1162 numEntries <<
" < numMissing = " <<
numMissing <<
"." <<
1174 const int myRank = comm->getRank ();
1177 "Tpetra::Details::DistributedNoncontiguousDirectory::getEntriesImpl: "
1178 "On Process " <<
myRank <<
": The 'imports' array must have length "
1181 packetSize <<
", numEntries (# GIDs): " << numEntries <<
1182 ", numMissing: " <<
numMissing <<
": distor.getTotalReceiveLength(): "
1183 <<
distor.getTotalReceiveLength () <<
". " << std::endl <<
1184 "Distributor description: " <<
distor.description () <<
". "
1186 "Please report this bug to the Tpetra developers.");
1189 Kokkos::View<global_size_t*, Kokkos::HostSpace> imports(
"imports",
packetSize *
distor.getTotalReceiveLength());
1194 std::ostringstream
os;
1203 std::ostringstream
os;
1217 std::ostringstream
os;
1235 if (
p1.first !=
p1.second) {
1251 std::logic_error,
funcPrefix <<
"On Process " <<
1252 comm->getRank () <<
": importsIndex = " <<
importsIndex
1253 <<
" > imports.size() = " << imports.size () <<
". "
1256 "numEntries (# GIDs): " << numEntries
1258 <<
": distor.getTotalReceiveLength(): "
1261 std::ostringstream
os;
1269 template<
class LO,
class GO,
class NT>
1272 isOneToOne (
const Teuchos::Comm<int>& comm)
const
1274 if (oneToOneResult_ == ONE_TO_ONE_NOT_CALLED_YET) {
1275 const int lcl121 = isLocallyOneToOne () ? 1 : 0;
1277 Teuchos::reduceAll<int, int> (comm, Teuchos::REDUCE_MIN,
lcl121,
1278 Teuchos::outArg (
gbl121));
1279 oneToOneResult_ = (
gbl121 == 1) ? ONE_TO_ONE_TRUE : ONE_TO_ONE_FALSE;
1281 return (oneToOneResult_ == ONE_TO_ONE_TRUE);
1291#define TPETRA_DIRECTORYIMPL_INSTANT(LO,GO,NODE) \
1292 namespace Details { \
1293 template class Directory< LO , GO , NODE >; \
1294 template class ReplicatedDirectory< LO , GO , NODE >; \
1295 template class ContiguousUniformDirectory< LO, GO, NODE >; \
1296 template class DistributedContiguousDirectory< LO , GO , NODE >; \
1297 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.