10 #ifndef __Tpetra_DirectoryImpl_decl_hpp
11 #define __Tpetra_DirectoryImpl_decl_hpp
31 #ifndef HAVE_TPETRA_DIRECTORY_SPARSE_MAP_FIX
32 # define HAVE_TPETRA_DIRECTORY_SPARSE_MAP_FIX 1
33 #endif // HAVE_TPETRA_DIRECTORY_SPARSE_MAP_FIX
35 #include "Tpetra_Details_FixedHashTable_decl.hpp"
37 #ifndef DOXYGEN_SHOULD_SKIP_THIS
40 template<
class OrdinalType>
43 #endif // DOXYGEN_SHOULD_SKIP_THIS
54 template<
class LocalOrdinal,
class GlobalOrdinal,
class NodeType>
57 typedef LocalOrdinal local_ordinal_type;
58 typedef GlobalOrdinal global_ordinal_type;
59 typedef NodeType node_type;
60 typedef ::Tpetra::Map<LocalOrdinal, GlobalOrdinal, NodeType>
map_type;
107 const Teuchos::ArrayView<const GlobalOrdinal> &globalIDs,
108 const Teuchos::ArrayView<int> &nodeIDs,
109 const Teuchos::ArrayView<LocalOrdinal> &localIDs,
110 const bool computeLIDs)
const;
118 virtual bool isOneToOne (
const Teuchos::Comm<int>& comm)
const = 0;
124 const Teuchos::ArrayView<const GlobalOrdinal> &globalIDs,
125 const Teuchos::ArrayView<int> &nodeIDs,
126 const Teuchos::ArrayView<LocalOrdinal> &localIDs,
127 const bool computeLIDs)
const = 0;
132 template<
class LocalOrdinal,
class GlobalOrdinal,
class NodeType>
134 public Directory<LocalOrdinal, GlobalOrdinal, NodeType> {
147 bool isOneToOne (
const Teuchos::Comm<int>& comm)
const override;
159 const Teuchos::ArrayView<const GlobalOrdinal> &globalIDs,
160 const Teuchos::ArrayView<int> &nodeIDs,
161 const Teuchos::ArrayView<LocalOrdinal> &localIDs,
162 const bool computeLIDs)
const override;
166 const int numProcs_ = 0;
178 template<
class LocalOrdinal,
class GlobalOrdinal,
class NodeType>
180 public Directory<LocalOrdinal, GlobalOrdinal, NodeType> {
208 const Teuchos::ArrayView<const GlobalOrdinal> &globalIDs,
209 const Teuchos::ArrayView<int> &nodeIDs,
210 const Teuchos::ArrayView<LocalOrdinal> &localIDs,
211 const bool computeLIDs)
const override;
217 template<
class LocalOrdinal,
class GlobalOrdinal,
class NodeType>
219 public Directory<LocalOrdinal, GlobalOrdinal, NodeType> {
246 const Teuchos::ArrayView<const GlobalOrdinal> &globalIDs,
247 const Teuchos::ArrayView<int> &nodeIDs,
248 const Teuchos::ArrayView<LocalOrdinal> &localIDs,
249 const bool computeLIDs)
const override;
277 Teuchos::ArrayRCP<GlobalOrdinal> allMinGIDs_;
282 template<
class LocalOrdinal,
class GlobalOrdinal,
class NodeType>
284 public Directory<LocalOrdinal, GlobalOrdinal, NodeType> {
286 template <
class LO,
class GO,
class N>
300 bool isOneToOne (
const Teuchos::Comm<int>& comm)
const override;
312 const Teuchos::ArrayView<const GlobalOrdinal> &globalIDs,
313 const Teuchos::ArrayView<int> &nodeIDs,
314 const Teuchos::ArrayView<LocalOrdinal> &localIDs,
315 const bool computeLIDs)
const override;
324 initialize (
const map_type& map,
325 Teuchos::Ptr<const tie_break_type> tie_break);
339 bool isLocallyOneToOne ()
const {
340 return locallyOneToOne_;
360 Teuchos::RCP<const map_type> directoryMap_;
370 Teuchos::ArrayRCP<int> PIDs_;
377 Teuchos::ArrayRCP<LocalOrdinal> LIDs_;
397 Kokkos::HostSpace::device_type>
399 Teuchos::RCP<lidToPidTable_type> lidToPidTable_;
415 Kokkos::HostSpace::device_type>
417 Teuchos::RCP<lidToLidTable_type> lidToLidTable_;
426 mutable enum EOneToOneResult {
427 ONE_TO_ONE_NOT_CALLED_YET,
435 bool locallyOneToOne_;
449 #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.