46 #ifndef MUELU_ZOLTAN2INTERFACE_DECL_HPP 47 #define MUELU_ZOLTAN2INTERFACE_DECL_HPP 51 #if defined(HAVE_MUELU_ZOLTAN2) && defined(HAVE_MPI) 53 #include <Xpetra_Matrix.hpp> 54 #include <Xpetra_MultiVectorFactory.hpp> 55 #include <Xpetra_VectorFactory.hpp> 64 #if defined(HAVE_MUELU_ZOLTAN) 65 #include "MueLu_ZoltanInterface.hpp" 115 template <
class Scalar,
116 class LocalOrdinal =
typename Xpetra::Matrix<Scalar>::local_ordinal_type,
117 class GlobalOrdinal =
typename Xpetra::Matrix<Scalar, LocalOrdinal>::global_ordinal_type,
118 class Node =
typename Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal>::node_type>
120 #undef MUELU_ZOLTAN2INTERFACE_SHORT 153 #ifdef HAVE_MUELU_EPETRA 155 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \ 156 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT)))) 158 #if defined(HAVE_MUELU_ZOLTAN) 167 #undef MUELU_ZOLTAN2INTERFACE_SHORT 171 level_ = rcp(
new Level());
174 level_->SetLevelID(1);
177 zoltanInterface_ = Teuchos::null;
178 level_ = Teuchos::null;
181 RCP<ParameterList> validParamList = rcp(
new ParameterList());
183 validParamList->set< RCP<const FactoryBase> > (
"A", Teuchos::null,
"Factory of the matrix A");
184 validParamList->set< RCP<const FactoryBase> > (
"Coordinates", Teuchos::null,
"Factory of the coordinates");
185 validParamList->set< RCP<const FactoryBase> > (
"number of partitions", Teuchos::null,
"Instance of RepartitionHeuristicFactory.");
186 validParamList->set< RCP<const ParameterList> > (
"ParameterList", Teuchos::null,
"Zoltan2 parameters");
188 return validParamList;
191 Input(currentLevel,
"A");
192 Input(currentLevel,
"number of partitions");
193 Input(currentLevel,
"Coordinates");
196 this->
GetOStream(
Warnings0) <<
"Tpetra does not support <double,int,int,EpetraNode> instantiation, " 197 "switching Zoltan2Interface to ZoltanInterface" << std::endl;
199 typedef Xpetra::MultiVector<double, LocalOrdinal, GlobalOrdinal, Node> dMultiVector;
202 level_->Set(
"A",
Get<RCP<Matrix> > (currentLevel,
"A"));
203 level_->Set(
"Coordinates",
Get<RCP<dMultiVector> >(currentLevel,
"Coordinates"));
204 level_->Set(
"number of partitions", currentLevel.
Get<GO>(
"number of partitions"));
206 level_->Request(
"Partition", zoltanInterface_.get());
207 zoltanInterface_->Build(*level_);
209 RCP<Xpetra::Vector<GO,LO,GO,NO> > decomposition;
210 level_->Get(
"Partition", decomposition, zoltanInterface_.get());
211 Set(currentLevel,
"Partition", decomposition);
229 #endif // HAVE_MUELU_ZOLTAN 233 #endif // HAVE_MUELU_EPETRA 237 #define MUELU_ZOLTAN2INTERFACE_SHORT 238 #endif //if defined(HAVE_MUELU_ZOLTAN2) && defined(HAVE_MPI) 240 #endif // MUELU_ZOLTAN2INTERFACE_DECL_HPP Important warning messages (one line)
void Build(Level ¤tLevel) const
Build an object with this factory.
void DeclareInput(Level ¤tLevel) const
Specifies the data that this class needs, and the factories that generate that data.
T & Get(const std::string &ename, const FactoryBase *factory=NoFactory::get())
Get data without decrementing associated storage counter (i.e., read-only access). Usage: Level->Get< RCP<Matrix> >("A", factory) if factory == NULL => use default factory.
RCP< ParameterList > defaultZoltan2Params
Teuchos::FancyOStream & GetOStream(MsgType type, int thisProcRankOnly=0) const
Get an output stream for outputting the input message type.
Zoltan2Interface()
Constructor.
Namespace for MueLu classes and methods.
Interface to Zoltan library.This interface provides access to partitioning methods in Zoltan...
virtual ~Zoltan2Interface()
Destructor.
void Build(Level ¤tLevel) const
Build an object with this factory.
RCP< const ParameterList > GetValidParameterList() const
Return a const parameter list of valid parameters that setParameterList() will accept.
Class that holds all level-specific information.
Interface to Zoltan2 library.This interface provides access to partitioning methods in Zoltan2...
RCP< ZoltanInterface > zoltanInterface_
T Get(Level &level, const std::string &varName) const
void Input(Level &level, const std::string &varName) const
virtual ~Zoltan2Interface()
Exception throws to report errors in the internal logical of the program.
Kokkos::Compat::KokkosSerialWrapperNode EpetraNode
void Set(Level &level, const std::string &varName, const T &data) const
RCP< const ParameterList > GetValidParameterList() const
Return a const parameter list of valid parameters that setParameterList() will accept.
Base class for factories that use one level (currentLevel).
void DeclareInput(Level ¤tLevel) const
Specifies the data that this class needs, and the factories that generate that data.