46 #ifndef MUELU_NODEPARTITIONINTERFACE_DEF_HPP
47 #define MUELU_NODEPARTITIONINTERFACE_DEF_HPP
56 #include <Teuchos_OpaqueWrapper.hpp>
65 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
68 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
71 #define SET_VALID_ENTRY(name) validParamList->setEntry(name, MasterList::getEntry(name))
73 #undef SET_VALID_ENTRY
76 validParamList->
set<
RCP<const FactoryBase> >(
"number of partitions", Teuchos::null,
"Instance of RepartitionHeuristicFactory.");
77 validParamList->
set<
RCP<const FactoryBase> >(
"Node Comm", Teuchos::null,
"Generating factory of the node level communicator");
81 return validParamList;
84 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
86 Input(currentLevel,
"A");
87 Input(currentLevel,
"number of partitions");
88 Input(currentLevel,
"Node Comm");
89 Input(currentLevel,
"Coordinates");
92 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
98 int numParts = Get<int>(level,
"number of partitions");
99 if (numParts == 1 || numParts == -1) {
102 Set(level,
"Partition", decomposition);
111 int nodeZeroRank = A->getMap()->getComm()->getRank();
112 Teuchos::broadcast<int, int>(*NodeComm, 0, Teuchos::inOutArg(nodeZeroRank));
117 decomposition->putScalar(Teuchos::as<GO>(nodeZeroRank));
119 Set(level,
"Partition", decomposition);
124 #endif // if defined(HAVE_MPI)
126 #endif // MUELU_NODEPARTITIONINTERFACE_DEF_HPP
void DeclareInput(Level ¤tLevel) const
Specifies the data that this class needs, and the factories that generate that data.
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
Timer to be used in factories. Similar to Monitor but with additional timers.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
NodePartitionInterface()
Constructor.
RCP< const ParameterList > GetValidParameterList() const
Return a const parameter list of valid parameters that setParameterList() will accept.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Class that holds all level-specific information.
static RCP< Vector > Build(const Teuchos::RCP< const Map > &map, bool zeroOut=true)
#define SET_VALID_ENTRY(name)
Exception throws to report errors in the internal logical of the program.
void Build(Level ¤tLevel) const
Build an object with this factory.