ALL 0.9.3
A Loadbalacing Library
Loading...
Searching...
No Matches
ALL::Histogram_LB< T, W > Class Template Reference

#include <ALL_Histogram.hpp>

+ Inheritance diagram for ALL::Histogram_LB< T, W >:
+ Collaboration diagram for ALL::Histogram_LB< T, W >:

Public Member Functions

 Histogram_LB ()
 default constructor
 
 Histogram_LB (int d, std::vector< W > w, T g)
 
 ~Histogram_LB ()
 default destructor
 
void balance (int step) override
 
virtual W getEstimatedEfficiency () override
 
std::vector< int > & getNeighbors () override
 
virtual void setAdditionalData (const void *data) override
 
void setup () override
 method to setup the loac-balancing method
 
- Public Member Functions inherited from ALL::LB< T, W >
 LB (const int dim, const T g)
 
virtual ~LB ()=default
 destructor
 
virtual int getDimension ()
 
double getEfficiency ()
 
virtual const T getGamma ()
 
virtual const std::vector< T > & getMinDomainSize ()
 
std::vector< T > & getNeighborVertices ()
 
int getNVertices ()
 
virtual std::vector< Point< T > > & getPrevVertices ()
 
virtual const std::vector< T > & getSysSize ()
 
virtual std::vector< Point< T > > & getVertices ()
 
virtual std::vector< W > & getWork ()
 
virtual void setCommunicator (const MPI_Comm comm)
 
virtual void setDimension (const int d)
 
virtual void setGamma (const T g)
 
virtual void setMinDomainSize (const std::vector< T > &minSize)
 
virtual void setSysSize (const std::vector< T > &newSysSize)
 
virtual void setVertices (const std::vector< Point< T > > &vertices_in)
 
virtual void setWork (const std::vector< W > &w)
 
virtual void setWork (const W w)
 

Additional Inherited Members

- Protected Member Functions inherited from ALL::LB< T, W >
void resizeVertices (const int newSize)
 
- Protected Attributes inherited from ALL::LB< T, W >
int dimension
 dimension of the used vertices
 
gamma
 correction factor
 
std::vector< int > global_dims
 dimensions of the global process grid
 
MPI_Comm globalComm
 used MPI communicator
 
std::vector< int > local_coords
 cartesian coordinates of the local domain in the process grid
 
int localRank
 local rank in the used MPI communicator
 
std::vector< T > minSize
 
std::vector< T > neighborVertices
 vertices describing neighboring domains
 
std::vector< int > periodicity
 periodicity of the MPI communicator / system
 
std::vector< Point< T > > prevVertices
 original vertices before previous balancing step
 
std::vector< T > sysSize
 (orthogonal) system size
 
std::vector< Point< T > > vertices
 local vertices after previous balancing step
 
std::vector< W > work
 local work
 

Detailed Description

template<class T, class W>
class ALL::Histogram_LB< T, W >

Load-balancing scheme based on the usage of global histograms in order to provide a most optimal decomposition of data. The decomposition is created by calling the balancing method three times. For each of the different dimensions the data is sorted into histograms (the correction factor gamma determines the width of each data bin) and using this as a cumulative distribution function a decomposition is computed where each chunk contains roughly the same amount of data. For the next dimensions this operation is repeated within the chunks provided by the previous call, therefore resulting after three call in a full three-dimensional decomposition. Between each call to the balancing method the data needs to be transferred according to the newly created domain boundaries.

Template Parameters
Tdata for vertices and related data
Wdata for work and related data

Definition at line 55 of file ALL_Histogram.hpp.

Constructor & Destructor Documentation

◆ Histogram_LB() [1/2]

template<class T, class W>
ALL::Histogram_LB< T, W >::Histogram_LB ( )
inline

default constructor

Definition at line 58 of file ALL_Histogram.hpp.

◆ Histogram_LB() [2/2]

template<class T, class W>
ALL::Histogram_LB< T, W >::Histogram_LB ( int d,
std::vector< W > w,
T g )
inline

constructor to initialize the main parameters

Parameters
dthe dimension of the used vertices
wthe multi-dimensional work of the local domain, the number of entries has to be equal to the number of bins overlapping the local domain in the current direction (bin width = correction factor gamma)
gthe correction factor, i.e. the width of a single bin

Definition at line 65 of file ALL_Histogram.hpp.

+ Here is the call graph for this function:

◆ ~Histogram_LB()

template<class T, class W>
ALL::Histogram_LB< T, W >::~Histogram_LB ( )
inline

default destructor

Definition at line 81 of file ALL_Histogram.hpp.

Member Function Documentation

◆ balance()

template<class T, class W>
void ALL::Histogram_LB< T, W >::balance ( int step)
overridevirtual

method to perform a single load-balancing step

Parameters
stepthe number the actual load-balancing step should get (e.g. if counting the number of loadbalancing steps)

Implements ALL::LB< T, W >.

Definition at line 267 of file ALL_Histogram.hpp.

◆ getEstimatedEfficiency()

template<class T, class W>
W ALL::Histogram_LB< T, W >::getEstimatedEfficiency ( )
overridevirtual

method to get an estimated work distribution after the balance step (currently only implemented in ALL::HISTOGRAM!)

Parameters
[out]doubleproviding the estimated LB after the balance step

Implements ALL::LB< T, W >.

Definition at line 727 of file ALL_Histogram.hpp.

◆ getNeighbors()

template<class T, class W>
std::vector< int > & ALL::Histogram_LB< T, W >::getNeighbors ( )
overridevirtual

method to provide a list of neighbors by MPI rank

Parameters
[out]listthe std::vector the list of neighbors is stored to

Implements ALL::LB< T, W >.

Definition at line 722 of file ALL_Histogram.hpp.

◆ setAdditionalData()

template<class T, class W>
void ALL::Histogram_LB< T, W >::setAdditionalData ( const void * data)
overridevirtual

method to set method specific data

Parameters
datapointer to an array of integers (int) containing the number of bins in the system for all three dimensions (int, int, int)

Implements ALL::LB< T, W >.

Definition at line 144 of file ALL_Histogram.hpp.

◆ setup()

template<class T, class W>
void ALL::Histogram_LB< T, W >::setup ( )
overridevirtual

method to setup the loac-balancing method

Implements ALL::LB< T, W >.

Definition at line 158 of file ALL_Histogram.hpp.


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