42 #ifndef __Tpetra_DirectoryImpl_decl_hpp
43 #define __Tpetra_DirectoryImpl_decl_hpp
48 #include <Tpetra_ConfigDefs.hpp>
64 #ifndef HAVE_TPETRA_DIRECTORY_SPARSE_MAP_FIX
65 # define HAVE_TPETRA_DIRECTORY_SPARSE_MAP_FIX 1
66 #endif // HAVE_TPETRA_DIRECTORY_SPARSE_MAP_FIX
68 #include <Tpetra_Details_FixedHashTable_decl.hpp>
70 #ifndef DOXYGEN_SHOULD_SKIP_THIS
73 template<
class OrdinalType>
76 #endif // DOXYGEN_SHOULD_SKIP_THIS
87 template<
class LocalOrdinal,
class GlobalOrdinal,
class NodeType>
90 typedef LocalOrdinal local_ordinal_type;
91 typedef GlobalOrdinal global_ordinal_type;
92 typedef NodeType node_type;
93 typedef ::Tpetra::Map<LocalOrdinal, GlobalOrdinal, NodeType>
map_type;
138 const Teuchos::ArrayView<const GlobalOrdinal> &globalIDs,
139 const Teuchos::ArrayView<int> &nodeIDs,
140 const Teuchos::ArrayView<LocalOrdinal> &localIDs,
141 const bool computeLIDs)
const;
149 virtual bool isOneToOne (
const Teuchos::Comm<int>& comm)
const = 0;
155 const Teuchos::ArrayView<const GlobalOrdinal> &globalIDs,
156 const Teuchos::ArrayView<int> &nodeIDs,
157 const Teuchos::ArrayView<LocalOrdinal> &localIDs,
158 const bool computeLIDs)
const = 0;
163 template<
class LocalOrdinal,
class GlobalOrdinal,
class NodeType>
165 public Directory<LocalOrdinal, GlobalOrdinal, NodeType> {
176 virtual bool isOneToOne (
const Teuchos::Comm<int>& comm)
const;
178 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
179 template <
class Node2>
181 clone (const ::Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node2>& cloneMap)
const
184 return new Dir2 (cloneMap);
198 const Teuchos::ArrayView<const GlobalOrdinal> &globalIDs,
199 const Teuchos::ArrayView<int> &nodeIDs,
200 const Teuchos::ArrayView<LocalOrdinal> &localIDs,
201 const bool computeLIDs)
const;
217 template<
class LocalOrdinal,
class GlobalOrdinal,
class NodeType>
219 public Directory<LocalOrdinal, GlobalOrdinal, NodeType> {
238 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
239 template <
class Node2>
241 clone (const ::Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node2>& cloneMap)
const
244 return new Dir2 (cloneMap);
259 const Teuchos::ArrayView<const GlobalOrdinal> &globalIDs,
260 const Teuchos::ArrayView<int> &nodeIDs,
261 const Teuchos::ArrayView<LocalOrdinal> &localIDs,
262 const bool computeLIDs)
const;
268 template<
class LocalOrdinal,
class GlobalOrdinal,
class NodeType>
270 public Directory<LocalOrdinal, GlobalOrdinal, NodeType> {
288 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
289 template <
class Node2>
291 clone (const ::Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node2>& cloneMap)
const
294 Dir2* dir =
new Dir2 (cloneMap);
296 dir->allMinGIDs_ = allMinGIDs_;
297 }
catch (std::exception& e) {
316 const Teuchos::ArrayView<const GlobalOrdinal> &globalIDs,
317 const Teuchos::ArrayView<int> &nodeIDs,
318 const Teuchos::ArrayView<LocalOrdinal> &localIDs,
319 const bool computeLIDs)
const;
345 Teuchos::ArrayRCP<GlobalOrdinal> allMinGIDs_;
350 template<
class LocalOrdinal,
class GlobalOrdinal,
class NodeType>
352 public Directory<LocalOrdinal, GlobalOrdinal, NodeType> {
370 virtual bool isOneToOne (
const Teuchos::Comm<int>& comm)
const;
372 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
373 template <
class Node2>
375 clone (const ::Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node2>& cloneMap)
const
379 typedef ::Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node2> output_map_type;
380 Dir2* dir =
new Dir2 (cloneMap);
385 RCP<const output_map_type> outDirMap;
387 outDirMap = directoryMap_->template clone<Node2> (cloneMap.getNode ());
390 outDirMap = Teuchos::null;
394 dir->directoryMap_ = outDirMap;
397 dir->lidToPidTable_ = lidToPidTable_;
398 dir->lidToLidTable_ = lidToLidTable_;
399 dir->useHashTables_ = useHashTables_;
414 const Teuchos::ArrayView<const GlobalOrdinal> &globalIDs,
415 const Teuchos::ArrayView<int> &nodeIDs,
416 const Teuchos::ArrayView<LocalOrdinal> &localIDs,
417 const bool computeLIDs)
const;
427 Teuchos::Ptr<const tie_break_type> tie_break);
441 bool isLocallyOneToOne ()
const {
442 return locallyOneToOne_;
462 Teuchos::RCP<const map_type> directoryMap_;
472 Teuchos::ArrayRCP<int> PIDs_;
479 Teuchos::ArrayRCP<LocalOrdinal> LIDs_;
491 Kokkos::Device<
typename NodeType::execution_space,
492 typename NodeType::memory_space> > > lidToPidTable_;
500 Kokkos::Device<
typename NodeType::execution_space,
501 typename NodeType::memory_space> > > lidToLidTable_;
510 mutable enum EOneToOneResult {
511 ONE_TO_ONE_NOT_CALLED_YET,
519 bool locallyOneToOne_;
533 #endif // __Tpetra_DirectoryImpl_decl_hpp
Interface for breaking ties in ownership.
Implementation of Directory for a locally replicated Map.
Interface for breaking ties in ownership.
std::string description() const
A one-line human-readable description of this object.
LookupStatus
Return status of Map remote index lookup (getRemoteIndexList()).
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
Find process IDs and (optionally) local IDs for the given global IDs.
Implementation of Directory for a distributed noncontiguous Map.
Implementation of Directory for a distributed contiguous Map.
virtual bool isOneToOne(const Teuchos::Comm< int > &comm) const
Whether the Directory's input Map is (globally) one to one.
ReplicatedDirectory()
Constructor (that takes no arguments).
virtual bool isOneToOne(const Teuchos::Comm< int > &comm) const
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
Find process IDs and (optionally) local IDs for the given global IDs.
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 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
A one-line human-readable description of this object.
A parallel distribution of indices over processes.
Computes the local ID and process ID corresponding to given global IDs.
std::string description() const
A one-line human-readable description of this object.
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
Find process IDs and (optionally) local IDs for the given global IDs.
Forward declaration of Tpetra::Map.
virtual bool isOneToOne(const Teuchos::Comm< int > &) const
Whether the Directory's input Map is (globally) one to one.