walberla::blockforest::DynamicDiffusionBalance< PhantomData_T > Class Template Reference

Detailed Description

template<typename PhantomData_T>
class walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >

This class implements a diffusive algorithm for load balancing.

All algorithms are implemented to work levelwise. Load balancing with levels ignored is possible by specifying levelwise = false in the constructor.

#include <DynamicDiffusive.h>

Public Types

enum  Mode { DIFFUSION_PUSH, DIFFUSION_PULL, DIFFUSION_PUSHPULL }
 

Public Member Functions

 DynamicDiffusionBalance (const uint_t maxIterations, const uint_t flowIterations, const bool levelwise=true)
 
void setMode (const Mode mode)
 
Mode getMode () const
 
void setMaxIterations (const uint_t maxIterations)
 
uint_t getMaxIterations () const
 
void defineProcessWeightLimitByMultipleOfMaxBlockWeight (const bool b)
 
bool defineProcessWeightLimitByMultipleOfMaxBlockWeight () const
 
void checkForEarlyAbort (const bool check, const double abortThreshold=1.0)
 
bool checkForEarlyAbort () const
 
void adaptOutflowWithGlobalInformation (const bool adapt)
 
bool adaptOutflowWithGlobalInformation () const
 
void adaptInflowWithGlobalInformation (const bool adapt)
 
bool adaptInflowWithGlobalInformation () const
 
void setFlowIterations (const uint_t flowIterations)
 
uint_t getFlowIterations () const
 
void setDynamicFlowIterationsIncrease (const uint_t startingBalanceIteration, const double increasePerBalanceIteration)
 
void regardConnectivity (const bool c)
 
bool regardConnectivity () const
 
void disregardConnectivity (const uint_t startingBalanceIteration)
 
void setOutflowExceedFactor (const double f)
 
double getOutflowExceedFactor () const
 
void setInflowExceedFactor (const double f)
 
double getInflowExceedFactor () const
 
bool operator() (std::vector< std::pair< const PhantomBlock *, uint_t > > &targetProcess, std::set< uint_t > &processesToRecvFrom, const PhantomBlockForest &phantomForest, const uint_t iteration)
 

Private Member Functions

double weight (const PhantomBlock *block) const
 

Private Attributes

Mode mode_
 
uint_t maxIterations_
 
bool defineProcessWeightLimitByMultipleOfMaxBlockWeight_
 
bool checkForEarlyAbort_
 
double abortThreshold_
 
bool adaptOutflowWithGlobalInformation_
 
bool adaptInflowWithGlobalInformation_
 
uint_t flowIterations_
 
uint_t flowIterationsIncreaseStart_
 
double flowIterationsIncrease_
 
bool regardConnectivity_
 
uint_t disregardConnectivityStart_
 
double outflowExceedFactor_
 
double inflowExceedFactor_
 
math::IntRandom< uint_trandom_
 
bool levelwise_
 All gets for levels are wrapped like. More...
 

Member Enumeration Documentation

◆ Mode

template<typename PhantomData_T >
enum walberla::blockforest::DynamicDiffusionBalance::Mode
Enumerator
DIFFUSION_PUSH 
DIFFUSION_PULL 
DIFFUSION_PUSHPULL 

Constructor & Destructor Documentation

◆ DynamicDiffusionBalance()

template<typename PhantomData_T >
walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::DynamicDiffusionBalance ( const uint_t  maxIterations,
const uint_t  flowIterations,
const bool  levelwise = true 
)
inline

Member Function Documentation

◆ adaptInflowWithGlobalInformation() [1/2]

template<typename PhantomData_T >
bool walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::adaptInflowWithGlobalInformation ( ) const
inline

◆ adaptInflowWithGlobalInformation() [2/2]

template<typename PhantomData_T >
void walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::adaptInflowWithGlobalInformation ( const bool  adapt)
inline

◆ adaptOutflowWithGlobalInformation() [1/2]

template<typename PhantomData_T >
bool walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::adaptOutflowWithGlobalInformation ( ) const
inline

◆ adaptOutflowWithGlobalInformation() [2/2]

template<typename PhantomData_T >
void walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::adaptOutflowWithGlobalInformation ( const bool  adapt)
inline

◆ checkForEarlyAbort() [1/2]

template<typename PhantomData_T >
bool walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::checkForEarlyAbort ( ) const
inline

◆ checkForEarlyAbort() [2/2]

template<typename PhantomData_T >
void walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::checkForEarlyAbort ( const bool  check,
const double  abortThreshold = 1.0 
)
inline

◆ defineProcessWeightLimitByMultipleOfMaxBlockWeight() [1/2]

template<typename PhantomData_T >
bool walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::defineProcessWeightLimitByMultipleOfMaxBlockWeight ( ) const
inline

◆ defineProcessWeightLimitByMultipleOfMaxBlockWeight() [2/2]

template<typename PhantomData_T >
void walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::defineProcessWeightLimitByMultipleOfMaxBlockWeight ( const bool  b)
inline

◆ disregardConnectivity()

template<typename PhantomData_T >
void walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::disregardConnectivity ( const uint_t  startingBalanceIteration)
inline

◆ getFlowIterations()

template<typename PhantomData_T >
uint_t walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::getFlowIterations ( ) const
inline

◆ getInflowExceedFactor()

template<typename PhantomData_T >
double walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::getInflowExceedFactor ( ) const
inline

◆ getMaxIterations()

template<typename PhantomData_T >
uint_t walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::getMaxIterations ( ) const
inline

◆ getMode()

template<typename PhantomData_T >
Mode walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::getMode ( ) const
inline

◆ getOutflowExceedFactor()

template<typename PhantomData_T >
double walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::getOutflowExceedFactor ( ) const
inline

◆ operator()()

template<typename PhantomData_T >
bool walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::operator() ( std::vector< std::pair< const PhantomBlock *, uint_t > > &  targetProcess,
std::set< uint_t > &  processesToRecvFrom,
const PhantomBlockForest phantomForest,
const uint_t  iteration 
)

◆ regardConnectivity() [1/2]

template<typename PhantomData_T >
bool walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::regardConnectivity ( ) const
inline

◆ regardConnectivity() [2/2]

template<typename PhantomData_T >
void walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::regardConnectivity ( const bool  c)
inline

◆ setDynamicFlowIterationsIncrease()

template<typename PhantomData_T >
void walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::setDynamicFlowIterationsIncrease ( const uint_t  startingBalanceIteration,
const double  increasePerBalanceIteration 
)
inline

◆ setFlowIterations()

template<typename PhantomData_T >
void walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::setFlowIterations ( const uint_t  flowIterations)
inline

◆ setInflowExceedFactor()

template<typename PhantomData_T >
void walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::setInflowExceedFactor ( const double  f)
inline

◆ setMaxIterations()

template<typename PhantomData_T >
void walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::setMaxIterations ( const uint_t  maxIterations)
inline

◆ setMode()

template<typename PhantomData_T >
void walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::setMode ( const Mode  mode)
inline

◆ setOutflowExceedFactor()

template<typename PhantomData_T >
void walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::setOutflowExceedFactor ( const double  f)
inline

◆ weight()

template<typename PhantomData_T >
double walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::weight ( const PhantomBlock block) const
inlineprivate

Member Data Documentation

◆ abortThreshold_

template<typename PhantomData_T >
double walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::abortThreshold_
private

◆ adaptInflowWithGlobalInformation_

template<typename PhantomData_T >
bool walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::adaptInflowWithGlobalInformation_
private

◆ adaptOutflowWithGlobalInformation_

template<typename PhantomData_T >
bool walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::adaptOutflowWithGlobalInformation_
private

◆ checkForEarlyAbort_

template<typename PhantomData_T >
bool walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::checkForEarlyAbort_
private

◆ defineProcessWeightLimitByMultipleOfMaxBlockWeight_

template<typename PhantomData_T >
bool walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::defineProcessWeightLimitByMultipleOfMaxBlockWeight_
private

◆ disregardConnectivityStart_

template<typename PhantomData_T >
uint_t walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::disregardConnectivityStart_
private

◆ flowIterations_

template<typename PhantomData_T >
uint_t walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::flowIterations_
private

◆ flowIterationsIncrease_

template<typename PhantomData_T >
double walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::flowIterationsIncrease_
private

◆ flowIterationsIncreaseStart_

template<typename PhantomData_T >
uint_t walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::flowIterationsIncreaseStart_
private

◆ inflowExceedFactor_

template<typename PhantomData_T >
double walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::inflowExceedFactor_
private

◆ levelwise_

template<typename PhantomData_T >
bool walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::levelwise_
private

All gets for levels are wrapped like.

levelwise_ ? getCorrectLevel() : 0

This allows to use the same algorithm for levelwise balancing as well as for balancing without levels.

◆ maxIterations_

template<typename PhantomData_T >
uint_t walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::maxIterations_
private

◆ mode_

template<typename PhantomData_T >
Mode walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::mode_
private

◆ outflowExceedFactor_

template<typename PhantomData_T >
double walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::outflowExceedFactor_
private

◆ random_

template<typename PhantomData_T >
math::IntRandom< uint_t > walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::random_
private

◆ regardConnectivity_

template<typename PhantomData_T >
bool walberla::blockforest::DynamicDiffusionBalance< PhantomData_T >::regardConnectivity_
private

The documentation for this class was generated from the following file:
bool levelwise_
All gets for levels are wrapped like.
Definition: DynamicDiffusive.h:150