46 #ifndef MUELU_NODEPARTITIONINTERFACE_DEF_HPP
47 #define MUELU_NODEPARTITIONINTERFACE_DEF_HPP
56 #include <Teuchos_OpaqueWrapper.hpp>
61 #include "MueLu_Utilities.hpp"
66 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
69 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
72 #define SET_VALID_ENTRY(name) validParamList->setEntry(name, MasterList::getEntry(name))
74 #undef SET_VALID_ENTRY
77 validParamList->
set<
RCP<const FactoryBase> > (
"number of partitions", Teuchos::null,
"Instance of RepartitionHeuristicFactory.");
78 validParamList->
set<
RCP<const FactoryBase> > (
"Node Comm", Teuchos::null,
"Generating factory of the node level communicator");
82 return validParamList;
86 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
88 Input(currentLevel,
"A");
89 Input(currentLevel,
"number of partitions");
90 Input(currentLevel,
"Node Comm");
91 Input(currentLevel,
"Coordinates");
94 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
100 int numParts = Get<int>(level,
"number of partitions");
101 if (numParts == 1 || numParts == -1) {
104 Set(level,
"Partition", decomposition);
113 int nodeZeroRank =A->getMap()->getComm()->getRank();
114 Teuchos::broadcast<int,int>(*NodeComm,0,Teuchos::inOutArg(nodeZeroRank));
119 decomposition->putScalar(Teuchos::as<GO>(nodeZeroRank));
121 Set(level,
"Partition", decomposition);
127 #endif //if defined(HAVE_MPI)
129 #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.