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

#include <ALL_Voronoi.hpp>

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

Public Member Functions

 Voronoi_LB ()
 default constructor
 
 Voronoi_LB (int d, W w, T g)
 
 ~Voronoi_LB () override
 default destructor
 
virtual void balance (int step) override
 
virtual W getEstimatedEfficiency () override
 
virtual std::vector< int > & getNeighbors () override
 
std::vector< T > & getNeighborVertices ()
 
virtual void setAdditionalData (known_unused const void *data) override
 
void setup () override
 setup internal data structures and parameters
 
- 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 setAdditionalData (const void *data)=0
 
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)
 

Public Attributes

voro::voronoicell vc
 

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::Voronoi_LB< T, W >

Load-balancing scheme based on Voronoi cells and the shift of their anchor points due to the ratio of work assigned to the local and neighboring domains. For each domain a center of work, i.e. the average of the particle locations, weighted by their indivual work share is computed (vertex 2). This and the work load of the local and the neighboring domains are used to compute a shift of the anchor point in the direction of the largest work load.

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

Definition at line 69 of file ALL_Voronoi.hpp.

Constructor & Destructor Documentation

◆ Voronoi_LB() [1/2]

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

default constructor

Definition at line 72 of file ALL_Voronoi.hpp.

◆ Voronoi_LB() [2/2]

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

constructor initializing basic parameters

Parameters
[in]dthe dimension of the used vertices
[in]wthe scalar work assigned to the local domain
[in]gthe correction factor gamma

Definition at line 77 of file ALL_Voronoi.hpp.

+ Here is the call graph for this function:

◆ ~Voronoi_LB()

template<class T , class W >
ALL::Voronoi_LB< T, W >::~Voronoi_LB ( )
override

default destructor

Definition at line 130 of file ALL_Voronoi.hpp.

Member Function Documentation

◆ balance()

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

method to execute a load-balancing step

Parameters
[in]stepnumber of the load-balancing step

Implements ALL::LB< T, W >.

Definition at line 176 of file ALL_Voronoi.hpp.

◆ getEstimatedEfficiency()

template<class T , class W >
virtual W ALL::Voronoi_LB< T, W >::getEstimatedEfficiency ( )
inlineoverridevirtual

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 110 of file ALL_Voronoi.hpp.

◆ getNeighbors()

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

method to provide a list of the neighbors of the local domain

Parameters
[out]listreference to a std::vector of integers where the list of neighbors will be assigned to

Implements ALL::LB< T, W >.

Definition at line 557 of file ALL_Voronoi.hpp.

◆ getNeighborVertices()

template<class T , class W >
std::vector< T > & ALL::Voronoi_LB< T, W >::getNeighborVertices ( )

method to get a list of the vertices of the neighboring domains

Parameters
[out]retlist of vertices of neighboring domains

◆ setAdditionalData()

template<class T , class W >
virtual void ALL::Voronoi_LB< T, W >::setAdditionalData ( known_unused const void * data)
inlineoverridevirtual

method to set specific data structures (unused for tensor grid method)

Parameters
[in]datapointer to the data structure

Definition at line 101 of file ALL_Voronoi.hpp.

◆ setup()

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

setup internal data structures and parameters

Implements ALL::LB< T, W >.

Definition at line 138 of file ALL_Voronoi.hpp.

Member Data Documentation

◆ vc

template<class T , class W >
voro::voronoicell ALL::Voronoi_LB< T, W >::vc

Definition at line 82 of file ALL_Voronoi.hpp.


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