40#ifndef TPETRA_DIRECTORYIMPL_DEF_HPP
41#define TPETRA_DIRECTORYIMPL_DEF_HPP
46#include "Tpetra_Distributor.hpp"
47#include "Tpetra_Map.hpp"
50#include "Tpetra_Details_FixedHashTable.hpp"
51#include "Teuchos_Comm.hpp"
56#ifdef HAVE_TPETRACORE_MPI
63 template<
class LO,
class GO,
class NT>
67 const Teuchos::ArrayView<const GO> &
globalIDs,
68 const Teuchos::ArrayView<int> &
nodeIDs,
69 const Teuchos::ArrayView<LO> &
localIDs,
75 std::invalid_argument, Teuchos::typeName(*
this) <<
"::getEntries(): "
76 "Output arrays do not have the right sizes. nodeIDs.size() = "
81 std::invalid_argument, Teuchos::typeName(*
this) <<
"::getEntries(): "
82 "Output array do not have the right sizes. localIDs.size() = "
94 Teuchos::OrdinalTraits<LO>::invalid ());
101 template<
class LO,
class GO,
class NT>
104 numProcs_ (
map.getComm ()->getSize ())
108 template<
class LO,
class GO,
class NT>
116 return (numProcs_ == 1);
120 template<
class LO,
class GO,
class NT>
124 std::ostringstream
os;
125 os <<
"ReplicatedDirectory"
126 <<
"<" << Teuchos::TypeNameTraits<LO>::name ()
127 <<
", " << Teuchos::TypeNameTraits<GO>::name ()
128 <<
", " << Teuchos::TypeNameTraits<NT>::name () <<
">";
133 template<
class LO,
class GO,
class NT>
138 Teuchos::typeName (*
this) <<
" constructor: Map is not contiguous.");
140 Teuchos::typeName (*
this) <<
" constructor: Map is not uniform.");
144 template<
class LO,
class GO,
class NT>
148 std::ostringstream
os;
149 os <<
"ContiguousUniformDirectory"
150 <<
"<" << Teuchos::TypeNameTraits<LO>::name ()
151 <<
", " << Teuchos::TypeNameTraits<GO>::name ()
152 <<
", " << Teuchos::TypeNameTraits<NT>::name () <<
">";
157 template<
class LO,
class GO,
class NT>
161 const Teuchos::ArrayView<const GO> &
globalIDs,
162 const Teuchos::ArrayView<int> &
nodeIDs,
163 const Teuchos::ArrayView<LO> &
localIDs,
168 typedef typename Teuchos::ArrayView<const GO>::size_type size_type;
169 const LO
invalidLid = Teuchos::OrdinalTraits<LO>::invalid ();
173 const GO
g_min =
map.getMinAllGlobalIndex ();
196 const size_type
N_G =
197 static_cast<size_type
> (
map.getGlobalNumElements ());
198 const size_type
P =
static_cast<size_type
> (comm->getSize ());
201 const size_type
N_R =
R * (
N_L +
static_cast<size_type
> (1));
203#ifdef HAVE_TPETRA_DEBUG
206 "Tpetra::ContiguousUniformDirectory::getEntriesImpl: "
207 "N_G = " <<
N_G <<
" != P*N_L + R = " <<
P <<
"*" <<
N_L <<
" + " <<
R
208 <<
" = " <<
P*
N_L +
R <<
". "
209 "Please report this bug to the Tpetra developers.");
215 const GO
ONE =
static_cast<GO
> (1);
230 else if (
g_0 <
static_cast<GO
> (
N_R)) {
235 else if (
g_0 >=
static_cast<GO
> (
N_R)) {
237 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.");
262 else if (
g_0 <
static_cast<GO
> (
N_R)) {
266 else if (
g_0 >=
static_cast<GO
> (
N_R)) {
268 const GO
g_R =
g_0 -
static_cast<GO
> (
N_R);
271#ifdef HAVE_TPETRA_DEBUG
274 "Tpetra::ContiguousUniformDirectory::getEntriesImpl: "
275 "should never get here. "
276 "Please report this bug to the Tpetra developers.");
284 template<
class LO,
class GO,
class NT>
289 using Teuchos::gatherAll;
295 Teuchos::typeName (*
this) <<
" constructor: Map is not distributed.");
297 Teuchos::typeName (*
this) <<
" constructor: Map is not contiguous.");
299 const int numProcs = comm->getSize ();
316#ifdef HAVE_TPETRACORE_MPI
319 if (
typeid (GO) ==
typeid (
int)) {
321 }
else if (
typeid (GO) ==
typeid (
long)) {
327 using Teuchos::rcp_dynamic_cast;
328 using Teuchos::MpiComm;
329 RCP<const MpiComm<int> > mpiComm =
330 rcp_dynamic_cast<const MpiComm<int> > (comm);
333 if (! comm.is_null ()) {
334 MPI_Comm rawMpiComm = * (mpiComm->getRawMpiComm ());
336 MPI_Allgather (&minMyGID, 1, rawMpiType,
337 allMinGIDs_.getRawPtr (), 1, rawMpiType,
339 TEUCHOS_TEST_FOR_EXCEPTION(err != MPI_SUCCESS, std::runtime_error,
340 "Tpetra::DistributedContiguousDirectory: MPI_Allgather failed");
342 gatherAll<int, GO> (*comm, 1, &minMyGID, numProcs, allMinGIDs_.getRawPtr ());
345 gatherAll<int, GO> (*comm, 1, &minMyGID, numProcs, allMinGIDs_.getRawPtr ());
348 gatherAll<int, GO> (*comm, 1, &minMyGID, numProcs, allMinGIDs_.getRawPtr ());
356 allMinGIDs_[numProcs] = map.getMaxAllGlobalIndex ()
357 + Teuchos::OrdinalTraits<GO>::one ();
360 template<
class LO,
class GO,
class NT>
364 std::ostringstream
os;
365 os <<
"DistributedContiguousDirectory"
366 <<
"<" << Teuchos::TypeNameTraits<LO>::name ()
367 <<
", " << Teuchos::TypeNameTraits<GO>::name ()
368 <<
", " << Teuchos::TypeNameTraits<NT>::name () <<
">";
372 template<
class LO,
class GO,
class NT>
376 const Teuchos::ArrayView<const GO> &
globalIDs,
377 const Teuchos::ArrayView<int> &
nodeIDs,
378 const Teuchos::ArrayView<LO> &
localIDs,
381 using Teuchos::Array;
382 using Teuchos::ArrayRCP;
383 using Teuchos::ArrayView;
390 const int myRank = comm->getRank ();
415 template<
class LO,
class GO,
class NT>
419 const Teuchos::ArrayView<const GO> &
globalIDs,
420 const Teuchos::ArrayView<int> &
nodeIDs,
421 const Teuchos::ArrayView<LO> &
localIDs,
424 using Teuchos::Array;
425 using Teuchos::ArrayRCP;
426 using Teuchos::ArrayView;
432 const int numProcs = comm->getSize ();
433 const LO
LINVALID = Teuchos::OrdinalTraits<LO>::invalid();
499 while (GID >= allMinGIDs_[
above]) {
526 template<
class LO,
class GO,
class NT>
529 oneToOneResult_ (ONE_TO_ONE_NOT_CALLED_YET),
530 locallyOneToOne_ (
true),
531 useHashTables_ (
false)
536 template<
class LO,
class GO,
class NT>
537 DistributedNoncontiguousDirectory<LO, GO, NT>::
538 DistributedNoncontiguousDirectory (
const map_type&
map,
540 oneToOneResult_ (ONE_TO_ONE_NOT_CALLED_YET),
541 locallyOneToOne_ (
true),
542 useHashTables_ (
false)
547 template<
class LO,
class GO,
class NT>
549 DistributedNoncontiguousDirectory<LO, GO, NT>::
550 initialize (
const map_type& map,
551 Teuchos::Ptr<const tie_break_type> tie_break)
554 using Teuchos::Array;
555 using Teuchos::ArrayRCP;
556 using Teuchos::ArrayView;
560 using Teuchos::typeName;
561 using Teuchos::TypeNameTraits;
564 typedef Array<int>::size_type size_type;
574 TEUCHOS_TEST_FOR_EXCEPTION(
sizeof(
global_size_t) <
sizeof(GO),
575 std::logic_error, typeName (*
this) <<
": sizeof(Tpetra::"
576 "global_size_t) = " <<
sizeof(
global_size_t) <<
" < sizeof(Global"
577 "Ordinal = " << TypeNameTraits<LO>::name () <<
") = " <<
sizeof(GO)
579 TEUCHOS_TEST_FOR_EXCEPTION(
sizeof(
global_size_t) <
sizeof(
int),
580 std::logic_error, typeName (*
this) <<
": sizeof(Tpetra::"
581 "global_size_t) = " <<
sizeof(
global_size_t) <<
" < sizeof(int) = "
582 <<
sizeof(
int) <<
".");
583 TEUCHOS_TEST_FOR_EXCEPTION(
sizeof(
global_size_t) <
sizeof(LO),
584 std::logic_error, typeName (*
this) <<
": sizeof(Tpetra::"
585 "global_size_t) = " <<
sizeof(
global_size_t) <<
" < sizeof(Local"
586 "Ordinal = " << TypeNameTraits<LO>::name () <<
") = " <<
sizeof(LO)
589 RCP<const Teuchos::Comm<int> > comm = map.getComm ();
590 const LO LINVALID = Teuchos::OrdinalTraits<LO>::invalid ();
591 const GO minAllGID = map.getMinAllGlobalIndex ();
592 const GO maxAllGID = map.getMaxAllGlobalIndex ();
599 const global_size_t numGlobalEntries = maxAllGID - minAllGID + 1;
609 directoryMap_ = rcp (
new map_type (numGlobalEntries, minAllGID, comm,
610 GloballyDistributed));
612 const size_t dir_numMyEntries = directoryMap_->getLocalNumElements ();
636 const size_t inverseSparsityThreshold = 10;
638 (dir_numMyEntries >= inverseSparsityThreshold * map.getLocalNumElements());
643 const int myRank = comm->getRank ();
644 const size_t numMyEntries = map.getLocalNumElements ();
645 Array<int> sendImageIDs (numMyEntries);
646 ArrayView<const GO> myGlobalEntries = map.getLocalElementList ();
651 directoryMap_->getRemoteIndexList (myGlobalEntries, sendImageIDs);
652 TEUCHOS_TEST_FOR_EXCEPTION(
653 lookupStatus ==
IDNotPresent, std::logic_error, Teuchos::typeName(*
this)
654 <<
" constructor: the Directory Map could not find out where one or "
655 "more of my Map's indices should go. The input to getRemoteIndexList "
656 "is " << Teuchos::toString (myGlobalEntries) <<
", and the output is "
657 << Teuchos::toString (sendImageIDs ()) <<
". The input Map itself has "
658 "the following entries on the calling process " <<
659 map.getComm ()->getRank () <<
": " <<
660 Teuchos::toString (map.getLocalElementList ()) <<
", and has "
661 << map.getGlobalNumElements () <<
" total global indices in ["
662 << map.getMinAllGlobalIndex () <<
"," << map.getMaxAllGlobalIndex ()
663 <<
"]. The Directory Map has "
664 << directoryMap_->getGlobalNumElements () <<
" total global indices in "
665 "[" << directoryMap_->getMinAllGlobalIndex () <<
"," <<
666 directoryMap_->getMaxAllGlobalIndex () <<
"], and the calling process "
667 "has GIDs [" << directoryMap_->getMinGlobalIndex () <<
"," <<
668 directoryMap_->getMaxGlobalIndex () <<
"]. "
669 "This probably means there is a bug in Map or Directory. "
670 "Please report this bug to the Tpetra developers.");
677 Distributor distor (comm);
678 const size_t numReceives = distor.createFromSends (sendImageIDs);
692 const int packetSize = 3;
693 Kokkos::View<GO*, Kokkos::HostSpace> exportEntries(
"exportEntries", packetSize * numMyEntries);
695 size_t exportIndex = 0;
696 for (
size_t i = 0; i < numMyEntries; ++i) {
697 exportEntries[exportIndex++] = myGlobalEntries[i];
698 exportEntries[exportIndex++] = as<GO> (myRank);
699 exportEntries[exportIndex++] = as<GO> (i);
705 Kokkos::View<GO*, Kokkos::HostSpace> importElements(
"importElements", packetSize * distor.getTotalReceiveLength());
708 distor.doPostsAndWaits(exportEntries, packetSize, importElements);
715 if (useHashTables_) {
730 LO* tableKeysRaw = NULL;
731 LO* tableLidsRaw = NULL;
732 int* tablePidsRaw = NULL;
734 tableKeysRaw =
new LO [numReceives];
735 tableLidsRaw =
new LO [numReceives];
736 tablePidsRaw =
new int [numReceives];
738 if (tableKeysRaw != NULL) {
739 delete [] tableKeysRaw;
741 if (tableLidsRaw != NULL) {
742 delete [] tableLidsRaw;
744 if (tablePidsRaw != NULL) {
745 delete [] tablePidsRaw;
749 ArrayRCP<LO> tableKeys (tableKeysRaw, 0, numReceives,
true);
750 ArrayRCP<LO> tableLids (tableLidsRaw, 0, numReceives,
true);
751 ArrayRCP<int> tablePids (tablePidsRaw, 0, numReceives,
true);
753 if (tie_break.is_null ()) {
755 size_type importIndex = 0;
756 for (size_type i = 0; i < static_cast<size_type> (numReceives); ++i) {
757 const GO curGID = importElements[importIndex++];
758 const LO curLID = directoryMap_->getLocalElement (curGID);
759 TEUCHOS_TEST_FOR_EXCEPTION(
760 curLID == LINVALID, std::logic_error,
761 Teuchos::typeName(*
this) <<
" constructor: Incoming global index "
762 << curGID <<
" does not have a corresponding local index in the "
763 "Directory Map. Please report this bug to the Tpetra developers.");
764 tableKeys[i] = curLID;
765 tablePids[i] = importElements[importIndex++];
766 tableLids[i] = importElements[importIndex++];
772 rcp (
new lidToPidTable_type (tableKeys (), tablePids ()));
773 locallyOneToOne_ = ! (lidToPidTable_->hasDuplicateKeys ());
775 rcp (
new lidToLidTable_type (tableKeys (), tableLids ()));
784 typedef std::map<LO, std::vector<std::pair<int, LO> > > pair_table_type;
785 pair_table_type ownedPidLidPairs;
789 size_type importIndex = 0;
790 for (size_type i = 0; i < static_cast<size_type> (numReceives); ++i) {
791 const GO curGID = importElements[importIndex++];
792 const LO dirMapLid = directoryMap_->getLocalElement (curGID);
793 TEUCHOS_TEST_FOR_EXCEPTION(
794 dirMapLid == LINVALID, std::logic_error,
795 Teuchos::typeName(*
this) <<
" constructor: Incoming global index "
796 << curGID <<
" does not have a corresponding local index in the "
797 "Directory Map. Please report this bug to the Tpetra developers.");
798 tableKeys[i] = dirMapLid;
799 const int PID = importElements[importIndex++];
800 const int LID = importElements[importIndex++];
810 ownedPidLidPairs[dirMapLid].push_back (std::make_pair (PID, LID));
823 for (size_type i = 0; i < static_cast<size_type> (numReceives); ++i) {
824 const LO dirMapLid = tableKeys[i];
825 const std::vector<std::pair<int, LO> >& pidLidList =
826 ownedPidLidPairs[dirMapLid];
827 const size_t listLen = pidLidList.size();
828 if (listLen == 0)
continue;
829 const GO dirMapGid = directoryMap_->getGlobalElement (dirMapLid);
831 locallyOneToOne_ =
false;
840 const size_type index =
841 static_cast<size_type
> (tie_break->selectedIndex (dirMapGid,
843 tablePids[i] = pidLidList[index].first;
844 tableLids[i] = pidLidList[index].second;
849 rcp (
new lidToPidTable_type (tableKeys (), tablePids ()));
851 rcp (
new lidToLidTable_type (tableKeys (), tableLids ()));
855 if (tie_break.is_null ()) {
860 PIDs_ = arcp<int> (dir_numMyEntries);
861 std::fill (PIDs_.begin (), PIDs_.end (), -1);
862 LIDs_ = arcp<LO> (dir_numMyEntries);
863 std::fill (LIDs_.begin (), LIDs_.end (), LINVALID);
865 size_type importIndex = 0;
866 for (size_type i = 0; i < static_cast<size_type> (numReceives); ++i) {
867 const GO curGID = importElements[importIndex++];
868 const LO curLID = directoryMap_->getLocalElement (curGID);
869 TEUCHOS_TEST_FOR_EXCEPTION(curLID == LINVALID, std::logic_error,
870 Teuchos::typeName(*
this) <<
" constructor: Incoming global index "
871 << curGID <<
" does not have a corresponding local index in the "
872 "Directory Map. Please report this bug to the Tpetra developers.");
877 if (PIDs_[curLID] != -1) {
878 locallyOneToOne_ =
false;
880 PIDs_[curLID] = importElements[importIndex++];
881 LIDs_[curLID] = importElements[importIndex++];
885 PIDs_ = arcp<int> (dir_numMyEntries);
886 LIDs_ = arcp<LO> (dir_numMyEntries);
887 std::fill (PIDs_.begin (), PIDs_.end (), -1);
896 Array<std::vector<std::pair<int, LO> > > ownedPidLidPairs (dir_numMyEntries);
897 size_t importIndex = 0;
898 for (
size_t i = 0; i < numReceives; ++i) {
899 const GO GID = importElements[importIndex++];
900 const int PID = importElements[importIndex++];
901 const LO LID = importElements[importIndex++];
903 const LO dirMapLid = directoryMap_->getLocalElement (GID);
904 TEUCHOS_TEST_FOR_EXCEPTION(
905 dirMapLid == LINVALID, std::logic_error,
906 Teuchos::typeName(*
this) <<
" constructor: Incoming global index "
907 << GID <<
" does not have a corresponding local index in the "
908 "Directory Map. Please report this bug to the Tpetra developers.");
909 ownedPidLidPairs[dirMapLid].push_back (std::make_pair (PID, LID));
921 for (
size_t i = 0; i < dir_numMyEntries; ++i) {
922 const std::vector<std::pair<int, LO> >& pidLidList =
924 const size_t listLen = pidLidList.size();
925 if (listLen == 0)
continue;
927 const LO dirMapLid =
static_cast<LO
> (i);
928 const GO dirMapGid = directoryMap_->getGlobalElement (dirMapLid);
930 locallyOneToOne_ =
false;
939 const size_type index =
940 static_cast<size_type
> (tie_break->selectedIndex (dirMapGid,
942 PIDs_[i] = pidLidList[index].first;
943 LIDs_[i] = pidLidList[index].second;
949 template<
class LO,
class GO,
class NT>
953 std::ostringstream
os;
954 os <<
"DistributedNoncontiguousDirectory"
955 <<
"<" << Teuchos::TypeNameTraits<LO>::name ()
956 <<
", " << Teuchos::TypeNameTraits<GO>::name ()
957 <<
", " << Teuchos::TypeNameTraits<NT>::name () <<
">";
961 template<
class LO,
class GO,
class NT>
965 const Teuchos::ArrayView<const GO> &
globalIDs,
966 const Teuchos::ArrayView<int> &
nodeIDs,
967 const Teuchos::ArrayView<LO> &
localIDs,
970 using Teuchos::Array;
971 using Teuchos::ArrayRCP;
972 using Teuchos::ArrayView;
975 using Teuchos::toString;
982 "DistributedNoncontiguousDirectory::getEntriesImpl: ";
984 " Please report this bug to the Tpetra developers.";
994 std::ostringstream
os;
996 if (
map.getComm ().is_null ()) {
1000 os <<
map.getComm ()->getRank ();
1004 new std::string(
os.str()));
1011 os <<
", computeLIDs: "
1016 const size_t numEntries =
globalIDs.size ();
1017 const LO
LINVALID = Teuchos::OrdinalTraits<LO>::invalid();
1034 std::ostringstream
os;
1035 os << *
procPrefix <<
"Call directoryMap_->getRemoteIndexList"
1041 std::ostringstream
os;
1042 os << *
procPrefix <<
"Director Map getRemoteIndexList out ";
1051 for (
size_t i=0;
i < numEntries; ++
i) {
1065 std::ostringstream
os;
1066 os << *
procPrefix <<
"Call Distributor::createFromRecvs"
1072 std::ostringstream
os;
1073 os << *
procPrefix <<
"Distributor::createFromRecvs result: "
1114 Kokkos::View<global_size_t*, Kokkos::HostSpace> exports(
"exports",
packetSize *
numSends);
1129 if (useHashTables_) {
1131 std::ostringstream
os;
1132 os << *
procPrefix <<
"Pack exports (useHashTables_ true)"
1140 const LO
curLID = directoryMap_->getLocalElement (
curGID);
1143 "Directory Map's global index " <<
curGID <<
" lacks "
1144 "a corresponding local index." <<
errSuffix);
1157 std::ostringstream
os;
1158 os << *
procPrefix <<
"Pack exports (useHashTables_ false)"
1166 const LO
curLID = directoryMap_->getLocalElement (
curGID);
1169 "Directory Map's global index " <<
curGID <<
" lacks "
1170 "a corresponding local index." <<
errSuffix);
1184 funcPrefix <<
"On Process " << comm->getRank () <<
", "
1185 "exportsIndex = " <<
exportsIndex <<
" > exports.size() = "
1186 << exports.size () <<
"." <<
errSuffix);
1191 "On Process " << comm->getRank () <<
", numEntries = " <<
1192 numEntries <<
" < numMissing = " <<
numMissing <<
"." <<
1204 const int myRank = comm->getRank ();
1207 "Tpetra::Details::DistributedNoncontiguousDirectory::getEntriesImpl: "
1208 "On Process " <<
myRank <<
": The 'imports' array must have length "
1211 packetSize <<
", numEntries (# GIDs): " << numEntries <<
1212 ", numMissing: " <<
numMissing <<
": distor.getTotalReceiveLength(): "
1213 <<
distor.getTotalReceiveLength () <<
". " << std::endl <<
1214 "Distributor description: " <<
distor.description () <<
". "
1216 "Please report this bug to the Tpetra developers.");
1219 Kokkos::View<global_size_t*, Kokkos::HostSpace> imports(
"imports",
packetSize *
distor.getTotalReceiveLength());
1224 std::ostringstream
os;
1233 std::ostringstream
os;
1247 std::ostringstream
os;
1265 if (
p1.first !=
p1.second) {
1281 std::logic_error,
funcPrefix <<
"On Process " <<
1282 comm->getRank () <<
": importsIndex = " <<
importsIndex
1283 <<
" > imports.size() = " << imports.size () <<
". "
1286 "numEntries (# GIDs): " << numEntries
1288 <<
": distor.getTotalReceiveLength(): "
1291 std::ostringstream
os;
1299 template<
class LO,
class GO,
class NT>
1302 isOneToOne (
const Teuchos::Comm<int>& comm)
const
1304 if (oneToOneResult_ == ONE_TO_ONE_NOT_CALLED_YET) {
1305 const int lcl121 = isLocallyOneToOne () ? 1 : 0;
1307 Teuchos::reduceAll<int, int> (comm, Teuchos::REDUCE_MIN,
lcl121,
1308 Teuchos::outArg (
gbl121));
1309 oneToOneResult_ = (
gbl121 == 1) ? ONE_TO_ONE_TRUE : ONE_TO_ONE_FALSE;
1311 return (oneToOneResult_ == ONE_TO_ONE_TRUE);
1321#define TPETRA_DIRECTORYIMPL_INSTANT(LO,GO,NODE) \
1322 namespace Details { \
1323 template class Directory< LO , GO , NODE >; \
1324 template class ReplicatedDirectory< LO , GO , NODE >; \
1325 template class ContiguousUniformDirectory< LO, GO, NODE >; \
1326 template class DistributedContiguousDirectory< LO , GO , NODE >; \
1327 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)
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.