40 #ifndef __Tpetra_DirectoryImpl_decl_hpp
41 #define __Tpetra_DirectoryImpl_decl_hpp
61 #ifndef HAVE_TPETRA_DIRECTORY_SPARSE_MAP_FIX
62 # define HAVE_TPETRA_DIRECTORY_SPARSE_MAP_FIX 1
63 #endif // HAVE_TPETRA_DIRECTORY_SPARSE_MAP_FIX
65 #include "Tpetra_Details_FixedHashTable_decl.hpp"
67 #ifndef DOXYGEN_SHOULD_SKIP_THIS
70 template<
class OrdinalType>
73 #endif // DOXYGEN_SHOULD_SKIP_THIS
84 template<
class LocalOrdinal,
class GlobalOrdinal,
class NodeType>
87 typedef LocalOrdinal local_ordinal_type;
88 typedef GlobalOrdinal global_ordinal_type;
89 typedef NodeType node_type;
90 typedef ::Tpetra::Map<LocalOrdinal, GlobalOrdinal, NodeType>
map_type;
137 const Teuchos::ArrayView<const GlobalOrdinal> &globalIDs,
138 const Teuchos::ArrayView<int> &nodeIDs,
139 const Teuchos::ArrayView<LocalOrdinal> &localIDs,
140 const bool computeLIDs)
const;
148 virtual bool isOneToOne (
const Teuchos::Comm<int>& comm)
const = 0;
154 const Teuchos::ArrayView<const GlobalOrdinal> &globalIDs,
155 const Teuchos::ArrayView<int> &nodeIDs,
156 const Teuchos::ArrayView<LocalOrdinal> &localIDs,
157 const bool computeLIDs)
const = 0;
162 template<
class LocalOrdinal,
class GlobalOrdinal,
class NodeType>
164 public Directory<LocalOrdinal, GlobalOrdinal, NodeType> {
177 bool isOneToOne (
const Teuchos::Comm<int>& comm)
const override;
189 const Teuchos::ArrayView<const GlobalOrdinal> &globalIDs,
190 const Teuchos::ArrayView<int> &nodeIDs,
191 const Teuchos::ArrayView<LocalOrdinal> &localIDs,
192 const bool computeLIDs)
const override;
196 const int numProcs_ = 0;
208 template<
class LocalOrdinal,
class GlobalOrdinal,
class NodeType>
210 public Directory<LocalOrdinal, GlobalOrdinal, NodeType> {
238 const Teuchos::ArrayView<const GlobalOrdinal> &globalIDs,
239 const Teuchos::ArrayView<int> &nodeIDs,
240 const Teuchos::ArrayView<LocalOrdinal> &localIDs,
241 const bool computeLIDs)
const override;
247 template<
class LocalOrdinal,
class GlobalOrdinal,
class NodeType>
249 public Directory<LocalOrdinal, GlobalOrdinal, NodeType> {
276 const Teuchos::ArrayView<const GlobalOrdinal> &globalIDs,
277 const Teuchos::ArrayView<int> &nodeIDs,
278 const Teuchos::ArrayView<LocalOrdinal> &localIDs,
279 const bool computeLIDs)
const override;
307 Teuchos::ArrayRCP<GlobalOrdinal> allMinGIDs_;
312 template<
class LocalOrdinal,
class GlobalOrdinal,
class NodeType>
314 public Directory<LocalOrdinal, GlobalOrdinal, NodeType> {
316 template <
class LO,
class GO,
class N>
330 bool isOneToOne (
const Teuchos::Comm<int>& comm)
const override;
342 const Teuchos::ArrayView<const GlobalOrdinal> &globalIDs,
343 const Teuchos::ArrayView<int> &nodeIDs,
344 const Teuchos::ArrayView<LocalOrdinal> &localIDs,
345 const bool computeLIDs)
const override;
354 initialize (
const map_type& map,
355 Teuchos::Ptr<const tie_break_type> tie_break);
369 bool isLocallyOneToOne ()
const {
370 return locallyOneToOne_;
390 Teuchos::RCP<const map_type> directoryMap_;
400 Teuchos::ArrayRCP<int> PIDs_;
407 Teuchos::ArrayRCP<LocalOrdinal> LIDs_;
419 Kokkos::Device<
typename NodeType::execution_space,
420 typename NodeType::memory_space> > > lidToPidTable_;
428 Kokkos::Device<
typename NodeType::execution_space,
429 typename NodeType::memory_space> > > lidToLidTable_;
438 mutable enum EOneToOneResult {
439 ONE_TO_ONE_NOT_CALLED_YET,
447 bool locallyOneToOne_;
461 #endif // __Tpetra_DirectoryImpl_decl_hpp
Interface for breaking ties in ownership.
Implementation of Directory for a locally replicated Map.
std::string description() const override
A one-line human-readable description of this object.
Interface for breaking ties in ownership.
LookupStatus
Return status of Map remote index lookup (getRemoteIndexList()).
Implementation of Directory for a distributed noncontiguous Map.
bool isOneToOne(const Teuchos::Comm< int > &) const override
Whether the Directory's input Map is (globally) one to one.
Directory()=default
Constructor.
bool isOneToOne(const Teuchos::Comm< int > &comm) const override
Whether the Directory's input Map is (globally) one to one.
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.
bool isOneToOne(const Teuchos::Comm< int > &comm) const override
Whether the Directory's input Map is (globally) one to one.
virtual 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 =0
Actually do the work of getEntries(), with no input validation.
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 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
std::string description() const override
A one-line human-readable description of this object.
A parallel distribution of indices over processes.
ReplicatedDirectory()=default
Constructor (that takes no arguments).
Computes the local ID and process ID corresponding to given global IDs.
virtual bool isOneToOne(const Teuchos::Comm< int > &comm) const =0
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.
std::string description() const override
A one-line human-readable description of this object.
Forward declaration of Tpetra::Map.