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_fwd.hpp>
54#include <Xpetra_VectorFactory_fwd.hpp>
62#if defined(HAVE_MUELU_ZOLTAN)
63#include "MueLu_ZoltanInterface.hpp"
117#undef MUELU_ZOLTAN2INTERFACE_SHORT
150#ifdef HAVE_MUELU_EPETRA
152#if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \
153 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT))))
155#if defined(HAVE_MUELU_ZOLTAN)
163 typedef Xpetra::EpetraNode
Node;
164#undef MUELU_ZOLTAN2INTERFACE_SHORT
167 typedef typename Teuchos::ScalarTraits<Scalar>::magnitudeType
real_type;
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");
196 Teuchos::ParameterEntry entry = pL.getEntry(
"ParameterList");
197 RCP<const Teuchos::ParameterList> providedList = Teuchos::any_cast<RCP<const Teuchos::ParameterList> >(entry.getAny(
false));
198 if (providedList != Teuchos::null && providedList->isType<std::string>(
"algorithm")) {
199 const std::string algo = providedList->get<std::string>(
"algorithm");
200 if (algo ==
"multijagged" || algo ==
"rcb")
201 Input(currentLevel,
"Coordinates");
203 Input(currentLevel,
"Coordinates");
206 this->
GetOStream(
Warnings0) <<
"Tpetra does not support <double,int,int,EpetraNode> instantiation, "
207 "switching Zoltan2Interface to ZoltanInterface" << std::endl;
210 level_->Set(
"A",
Get<RCP<Matrix> > (currentLevel,
"A"));
211 level_->Set(
"Coordinates",
Get<RCP<RealValuedMultiVector> >(currentLevel,
"Coordinates"));
212 level_->Set(
"number of partitions", currentLevel.
Get<GO>(
"number of partitions"));
217 RCP<Xpetra::Vector<GO,LO,GO,NO> > decomposition;
219 Set(currentLevel,
"Partition", decomposition);
235 void Build(Level &level)
const {};
245#define MUELU_ZOLTAN2INTERFACE_SHORT
Tpetra::KokkosCompat::KokkosSerialWrapperNode EpetraNode
MueLu::DefaultLocalOrdinal LocalOrdinal
MueLu::DefaultScalar Scalar
MueLu::DefaultGlobalOrdinal GlobalOrdinal
Exception throws to report errors in the internal logical of the program.
void Input(Level &level, const std::string &varName) const
T Get(Level &level, const std::string &varName) const
void Set(Level &level, const std::string &varName, const T &data) const
Class that holds all level-specific information.
T & Get(const std::string &ename, const FactoryBase *factory=NoFactory::get())
Get data without decrementing associated storage counter (i.e., read-only access)....
virtual const Teuchos::ParameterList & GetParameterList() const
Base class for factories that use one level (currentLevel).
SingleLevelFactoryBase()
Constructor.
Teuchos::FancyOStream & GetOStream(MsgType type, int thisProcRankOnly=0) const
Get an output stream for outputting the input message type.
RCP< const ParameterList > GetValidParameterList() const
Return a const parameter list of valid parameters that setParameterList() will accept.
virtual ~Zoltan2Interface()
RCP< ZoltanInterface > zoltanInterface_
void DeclareInput(Level ¤tLevel) const
Specifies the data that this class needs, and the factories that generate that data.
Teuchos::ScalarTraits< Scalar >::magnitudeType real_type
Xpetra::MultiVector< real_type, LO, GO, NO > RealValuedMultiVector
void Build(Level ¤tLevel) const
Build an object with this factory.
Interface to Zoltan2 library.
void DeclareInput(Level ¤tLevel) const
Specifies the data that this class needs, and the factories that generate that data.
RCP< const ParameterList > GetValidParameterList() const
Return a const parameter list of valid parameters that setParameterList() will accept.
Zoltan2Interface()
Constructor.
void Build(Level ¤tLevel) const
Build an object with this factory.
virtual ~Zoltan2Interface()
Destructor.
RCP< ParameterList > defaultZoltan2Params
Interface to Zoltan library.
Namespace for MueLu classes and methods.
@ Warnings0
Important warning messages (one line).
Tpetra::KokkosClassic::DefaultNode::DefaultNodeType DefaultNode