MueLu  Version of the Day
MueLu::RepartitionFactory< Scalar, LocalOrdinal, GlobalOrdinal, Node > Class Template Reference

Factory for building permutation matrix that can be be used to shuffle data (matrices, vectors) among processes. More...

#include <MueLu_RepartitionFactory_decl.hpp>

Inheritance diagram for MueLu::RepartitionFactory< Scalar, LocalOrdinal, GlobalOrdinal, Node >:
MueLu::SingleLevelFactoryBase MueLu::Factory MueLu::FactoryBase MueLu::FactoryAcceptor MueLu::ParameterListAcceptorImpl MueLu::BaseClass MueLu::ParameterListAcceptor MueLu::VerboseObject MueLu::Describable

Constructors/Destructors.

 RepartitionFactory ()
 Constructor. More...
 
virtual ~RepartitionFactory ()
 Destructor. More...
 
RCP< const ParameterList > GetValidParameterList () const
 Return a const parameter list of valid parameters that setParameterList() will accept. More...
 

Input

void DeclareInput (Level &currentLevel) const
 Determines the data that RepartitionFactory needs, and the factories that generate that data. More...
 

Build methods.

void Build (Level &currentLevel) const
 Build an object with this factory. More...
 

Helper methods.

void DeterminePartitionPlacement (const Matrix &A, GOVector &decomposition, GO numPartitions) const
 Determine which process should own each partition. More...
 

Additional Inherited Members

- Public Member Functions inherited from MueLu::SingleLevelFactoryBase
 SingleLevelFactoryBase ()
 Constructor. More...
 
virtual ~SingleLevelFactoryBase ()
 Destructor. More...
 
virtual void CallBuild (Level &requestedLevel) const
 
virtual void CallDeclareInput (Level &requestedLevel) const
 
- Public Member Functions inherited from MueLu::Factory
void EnableMultipleCallCheck () const
 
void DisableMultipleCallCheck () const
 
void ResetDebugData () const
 
 Factory ()
 Constructor. More...
 
virtual ~Factory ()
 Destructor. More...
 
virtual void SetFactory (const std::string &varName, const RCP< const FactoryBase > &factory)
 Configuration. More...
 
const RCP< const FactoryBaseGetFactory (const std::string &varName) const
 Default implementation of FactoryAcceptor::GetFactory() More...
 
RCP< ParameterList > RemoveFactoriesFromList (const ParameterList &list) const
 
- Public Member Functions inherited from MueLu::FactoryBase
 FactoryBase ()
 Constructor. More...
 
virtual ~FactoryBase ()
 Destructor. More...
 
int GetID () const
 return unique factory id More...
 
- Public Member Functions inherited from MueLu::BaseClass
virtual ~BaseClass ()
 Destructor. More...
 
- Public Member Functions inherited from MueLu::VerboseObject
VerbLevel GetVerbLevel () const
 Get the verbosity level. More...
 
void SetVerbLevel (const VerbLevel verbLevel)
 Set the verbosity level of this object. More...
 
int GetProcRankVerbose () const
 Get proc rank used for printing. Do not use this information for any other purpose. More...
 
int SetProcRankVerbose (int procRank) const
 Set proc rank used for printing. More...
 
bool IsPrint (MsgType type, int thisProcRankOnly=-1) const
 Find out whether we need to print out information for a specific message type. More...
 
Teuchos::FancyOStream & GetOStream (MsgType type, int thisProcRankOnly=0) const
 Get an output stream for outputting the input message type. More...
 
Teuchos::FancyOStream & GetBlackHole () const
 
 VerboseObject ()
 
virtual ~VerboseObject ()
 Destructor. More...
 
- Public Member Functions inherited from MueLu::Describable
virtual ~Describable ()
 Destructor. More...
 
virtual std::string ShortClassName () const
 Return the class name of the object, without template parameters and without namespace. More...
 
virtual void describe (Teuchos::FancyOStream &out_arg, const VerbLevel verbLevel=Default) const
 
virtual std::string description () const
 Return a simple one-line description of this object. More...
 
void describe (Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
 Print the object with some verbosity level to an FancyOStream object. More...
 
- Public Member Functions inherited from MueLu::FactoryAcceptor
virtual ~FactoryAcceptor ()
 
- Public Member Functions inherited from MueLu::ParameterListAcceptorImpl
 ParameterListAcceptorImpl ()
 
virtual ~ParameterListAcceptorImpl ()
 
virtual void SetParameterList (const ParameterList &paramList)
 Set parameters from a parameter list and return with default values. More...
 
virtual const Teuchos::ParameterList & GetParameterList () const
 
void SetParameter (const std::string &name, const ParameterEntry &entry)
 Set a parameter directly as a ParameterEntry. More...
 
const ParameterEntry & GetParameter (const std::string &name) const
 Retrieves a const entry with the name name. More...
 
virtual void GetDocumentation (std::ostream &os) const
 
- Public Member Functions inherited from MueLu::ParameterListAcceptor
 ParameterListAcceptor ()
 
virtual ~ParameterListAcceptor ()
 
- Static Public Member Functions inherited from MueLu::Factory
static void EnableTimerSync ()
 
static void DisableTimerSync ()
 
static void EnableMultipleCheckGlobally ()
 
static void DisableMultipleCheckGlobally ()
 
- Static Public Member Functions inherited from MueLu::VerboseObject
static void SetDefaultOStream (const Teuchos::RCP< Teuchos::FancyOStream > &defaultOStream)
 
static Teuchos::RCP< Teuchos::FancyOStream > GetDefaultOStream ()
 
static void SetDefaultVerbLevel (const VerbLevel defaultVerbLevel)
 Set the default (global) verbosity level. More...
 
static VerbLevel GetDefaultVerbLevel ()
 Get the default (global) verbosity level. More...
 
- Protected Member Functions inherited from MueLu::Factory
void Input (Level &level, const std::string &varName) const
 
void Input (Level &level, const std::string &varName, const std::string &varParamName) const
 
template<class T >
Get (Level &level, const std::string &varName) const
 
template<class T >
Get (Level &level, const std::string &varName, const std::string &varParamName) const
 
template<class T >
void Set (Level &level, const std::string &varName, const T &data) const
 
bool IsAvailable (Level &level, const std::string &varName) const
 
- Static Protected Attributes inherited from MueLu::Factory
static bool timerSync_ = false
 

Detailed Description

template<class Scalar = double, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = KokkosClassic::DefaultNode::DefaultNodeType>
class MueLu::RepartitionFactory< Scalar, LocalOrdinal, GlobalOrdinal, Node >

Factory for building permutation matrix that can be be used to shuffle data (matrices, vectors) among processes.

This factory acts on both the number of partitions and a vector (usually created by Zoltan) that indicates to which partitions the current level's system matrix's DOFS belong.

We always call the Interface routines in ZoltanInterface, Zoltan2Interface or IsorropiaInterface, but they have special short-cuts if no rebalancing is necessary (then return "Partition = null") or all data is moved to one processor.

Input/output of RepartitionInterface

User parameters of RepartitionInterface

Parameter type default master.xml validated requested description
A Factory null * * Generating factory of the matrix A used during the prolongator smoothing process
number of partitions Factory null * * Factory calculating the "number of partitions" for rebalancing (usually an instance of RepartitionHeuristicFactory)
Partition Factory null * * Factory generating the "Partition" variable containing the distribution of the DOFs over the reduced number of processors (given by "number of partitions")
repartition: print partition distribution bool false * * Partition distribution printout.
repartition: remap parts bool false * * Postprocessing for partitioning to reduce data migration.
repartition: remap num values int 4 * * Number of maximum components from each processor used to construct partial bipartite graph.

The * in the master.xml column denotes that the parameter is defined in the master.xml file.
The * in the validated column means that the parameter is declared in the list of valid input parameters (see RepartitionFactory::GetValidParameters).
The * in the requested column states that the data is requested as input with all dependencies (see RepartitionFactory::DeclareInput).

Variables provided by RepartitionInterface

After RepartitionFactory::Build the following data is available (if requested)

Parameter generated by description
Importer RepartitionFactory Importer used for rebalancing

Importer contains the Xpetra::Import object to rebalance the data (matrix or vectors). It is Teuchos::null if no rebalancing is necessary.

Note
For blocked systems you need one RepartionFactory for each sub block together with a separate Instance of an Interface class.

Definition at line 112 of file MueLu_RepartitionFactory_decl.hpp.

Constructor & Destructor Documentation

◆ RepartitionFactory()

template<class Scalar = double, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = KokkosClassic::DefaultNode::DefaultNodeType>
MueLu::RepartitionFactory< Scalar, LocalOrdinal, GlobalOrdinal, Node >::RepartitionFactory ( )
inline

Constructor.

Definition at line 121 of file MueLu_RepartitionFactory_decl.hpp.

◆ ~RepartitionFactory()

template<class Scalar = double, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = KokkosClassic::DefaultNode::DefaultNodeType>
virtual MueLu::RepartitionFactory< Scalar, LocalOrdinal, GlobalOrdinal, Node >::~RepartitionFactory ( )
inlinevirtual

Destructor.

Definition at line 124 of file MueLu_RepartitionFactory_decl.hpp.

Member Function Documentation

◆ GetValidParameterList()

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
RCP< const ParameterList > MueLu::RepartitionFactory< Scalar, LocalOrdinal, GlobalOrdinal, Node >::GetValidParameterList ( ) const
virtual

Return a const parameter list of valid parameters that setParameterList() will accept.

Also define the default values of parameters according to the input parameter list.

Reimplemented from MueLu::Factory.

Definition at line 81 of file MueLu_RepartitionFactory_def.hpp.

◆ DeclareInput()

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
void MueLu::RepartitionFactory< Scalar, LocalOrdinal, GlobalOrdinal, Node >::DeclareInput ( Level currentLevel) const
virtual

Determines the data that RepartitionFactory needs, and the factories that generate that data.

If this class requires some data, but the generating factory is not specified in DeclareInput, then this class will fall back to the settings in FactoryManager.

Implements MueLu::SingleLevelFactoryBase.

Definition at line 98 of file MueLu_RepartitionFactory_def.hpp.

◆ Build()

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
void MueLu::RepartitionFactory< Scalar, LocalOrdinal, GlobalOrdinal, Node >::Build ( Level currentLevel) const
virtual

Build an object with this factory.

Implements MueLu::SingleLevelFactoryBase.

Definition at line 112 of file MueLu_RepartitionFactory_def.hpp.

◆ DeterminePartitionPlacement()

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
void MueLu::RepartitionFactory< Scalar, LocalOrdinal, GlobalOrdinal, Node >::DeterminePartitionPlacement ( const Matrix &  A,
GOVector &  decomposition,
GO  numPartitions 
) const

Determine which process should own each partition.

Partitions are assigned to processes in order to minimize data movement. The basic idea is that a good choice for partition owner is to choose the pid that already has the greatest number of nonzeros for a particular partition.

Definition at line 408 of file MueLu_RepartitionFactory_def.hpp.


The documentation for this class was generated from the following files: