42 #ifndef TPETRA_DIRECTORY_HPP 43 #define TPETRA_DIRECTORY_HPP 46 #include <Tpetra_ConfigDefs.hpp> 47 #include <Tpetra_Distributor.hpp> 48 #include <Tpetra_Map.hpp> 49 #include <Tpetra_DirectoryImpl.hpp> 50 #include <Tpetra_DirectoryImpl_def.hpp> 52 #ifdef DOXYGEN_USE_ONLY 53 # include "Tpetra_Directory_decl.hpp" 58 template<
class LO,
class GO,
class NT>
59 Directory<LO, GO, NT>::
60 Directory (
const Teuchos::RCP<
const Map<LO, GO, NT> >& map)
65 RCP<const Details::Directory<LO, GO, NT> > dir;
66 if (map->isDistributed ()) {
67 if (map->isUniform ()) {
68 dir =
rcp (
new Details::ContiguousUniformDirectory<LO, GO, NT> (map));
70 else if (map->isContiguous ()) {
71 dir =
rcp (
new Details::DistributedContiguousDirectory<LO, GO, NT> (map));
74 dir =
rcp (
new Details::DistributedNoncontiguousDirectory<LO, GO, NT> (map));
78 dir =
rcp (
new Details::ReplicatedDirectory<LO, GO, NT> (map));
81 "Directory constructor failed to create Directory implementation. " 82 "Please report this bug to the Tpetra developers.");
86 template<
class LO,
class GO,
class NT>
87 Directory<LO, GO, NT>::Directory() {}
89 template<
class LO,
class GO,
class NT>
92 template<
class LO,
class GO,
class NT>
98 const bool computeLIDs =
false;
99 return impl_->getEntries (globalIDs, nodeIDs, Teuchos::null, computeLIDs);
102 template<
class LO,
class GO,
class NT>
109 const bool computeLIDs =
true;
110 return impl_->getEntries (globalIDs, nodeIDs, localIDs, computeLIDs);
113 template<
class LO,
class GO,
class NT>
119 std::ostringstream os;
121 <<
"<" << TypeNameTraits<LO>::name ()
122 <<
", " << TypeNameTraits<GO>::name ()
123 <<
", " << TypeNameTraits<NT>::name () <<
">";
135 #define TPETRA_DIRECTORY_INSTANT(LO,GO,NODE) \ 137 template class Directory< LO , GO , NODE >; \ 139 #endif // TPETRA_DIRECTORY_HPP Namespace Tpetra contains the class and methods constituting the Tpetra library.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
LookupStatus getDirectoryEntries(const Teuchos::ArrayView< const GlobalOrdinal > &globalIDs, const Teuchos::ArrayView< int > &nodeIDs) const
Given a global ID list, return the list of their owning process IDs.
std::string description() const
A one-line human-readable description of this object.