10 #ifndef MUELU_NODEPARTITIONINTERFACE_DEF_HPP
11 #define MUELU_NODEPARTITIONINTERFACE_DEF_HPP
20 #include <Teuchos_OpaqueWrapper.hpp>
29 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
32 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
35 #define SET_VALID_ENTRY(name) validParamList->setEntry(name, MasterList::getEntry(name))
37 #undef SET_VALID_ENTRY
40 validParamList->
set<
RCP<const FactoryBase> >(
"number of partitions", Teuchos::null,
"Instance of RepartitionHeuristicFactory.");
41 validParamList->
set<
RCP<const FactoryBase> >(
"Node Comm", Teuchos::null,
"Generating factory of the node level communicator");
45 return validParamList;
48 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
50 Input(currentLevel,
"A");
51 Input(currentLevel,
"number of partitions");
52 Input(currentLevel,
"Node Comm");
53 Input(currentLevel,
"Coordinates");
56 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
62 int numParts = Get<int>(level,
"number of partitions");
63 if (numParts == 1 || numParts == -1) {
66 Set(level,
"Partition", decomposition);
75 int nodeZeroRank = A->getMap()->getComm()->getRank();
76 Teuchos::broadcast<int, int>(*NodeComm, 0, Teuchos::inOutArg(nodeZeroRank));
81 decomposition->putScalar(Teuchos::as<GO>(nodeZeroRank));
83 Set(level,
"Partition", decomposition);
88 #endif // if defined(HAVE_MPI)
90 #endif // MUELU_NODEPARTITIONINTERFACE_DEF_HPP
void DeclareInput(Level ¤tLevel) const
Specifies the data that this class needs, and the factories that generate that data.
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.
ParameterList & set(std::string const &name, T &&value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
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.