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

#include <ALL.hpp>

Public Member Functions

 ALL ()
 
 ALL (const LB_t m, const int d, const std::vector< Point< T > > &inp, const T g)
 
 ALL (const LB_t m, const int d, const T g)
 
 ~ALL ()=default
 destructor
 
std::vector< Point< T > > & balance ()
 
int getDimension ()
 
getEfficiency ()
 
getEstimatedEfficiency ()
 
getGamma ()
 
std::vector< int > & getNeighbors ()
 
std::vector< T > & getNeighborVertices ()
 
std::vector< Point< T > > & getPrevVertices ()
 
std::vector< Point< T > > & getVertices ()
 
getWork ()
 
void getWork (std::vector< W > &result)
 
void printVTKoutlines (const int step)
 
void printVTKvertices (const int step)
 
void setCommunicator (const MPI_Comm comm)
 
void setGamma (const T g)
 
void setMethodData (const void *data)
 
void setMinDomainSize (const std::vector< T > &minSize)
 
void setProcGridParams (const std::vector< int > &loc, const std::vector< int > &size)
 
void setProcTag (int tag)
 
void setSysSize (const std::vector< T > &sysSize)
 
void setup ()
 
void setVertices (const std::vector< Point< T > > &inp)
 
void setWork (const std::vector< W > &work)
 
void setWork (const W work)
 

Detailed Description

template<class T, class W>
class ALL::ALL< T, W >
Template Parameters
Tdata type for vertices and related data
Wdata type for work and related data

Definition at line 102 of file ALL.hpp.

Constructor & Destructor Documentation

◆ ALL() [1/3]

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

default constructor, that sets up internal data structures and initializes internal values shared between all balancing methods

Definition at line 106 of file ALL.hpp.

◆ ALL() [2/3]

template<class T, class W>
ALL::ALL< T, W >::ALL ( const LB_t m,
const int d,
const T g )
inline

constructor providing the balancing method to use, the dimensions of the vertices and the gamma correction value and setting the chosen balancing methods up

Parameters
[in]mthe balancing method to be used
[in]dthe dimension of the vertices to be used (most methods currently only support 3D vertices)
[in]gthe value used for the correction value, if required by the chosen balancing method

Definition at line 142 of file ALL.hpp.

◆ ALL() [3/3]

template<class T, class W>
ALL::ALL< T, W >::ALL ( const LB_t m,
const int d,
const std::vector< Point< T > > & inp,
const T g )
inline

constructor to setup the method, the dimension of the used vertices, the correction value and also providing a first set of vertices to start from

Parameters
[in]mthe balancing method to be used
[in]dthe dimension of the vertices to be used (most methods currently only support 3D vertices)
[in]inpthe set of vertices to be used in the balancing step
[in]gthe value used for the correction value, if required by the chosen balancing method

Definition at line 183 of file ALL.hpp.

◆ ~ALL()

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

destructor

Member Function Documentation

◆ balance()

template<class T, class W>
std::vector< Point< T > > & ALL::ALL< T, W >::balance ( )
inline

method the trigger the balancing step, that updates the vertices according to the previously provided work and chosen method

Parameters
[in]internaltoggles if internal steps are performed, needed for some recursive calls of the routine by some methods
Returns
std::vector<ALL::Point<T>> containing the shifted set of vertices

Definition at line 299 of file ALL.hpp.

+ Here is the caller graph for this function:

◆ getDimension()

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

get the dimension of the ALL::Point<T> objects used to describe the vertices of the domains

Returns
int containing the dimension of the vertices

Definition at line 428 of file ALL.hpp.

+ Here is the caller graph for this function:

◆ getEfficiency()

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

method to provide the current load-balancing efficiency

Returns
the current LB efficiency (only valid before balance() was called)

Definition at line 454 of file ALL.hpp.

+ Here is the caller graph for this function:

◆ getEstimatedEfficiency()

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

method to provide an estimated work efficiency after the balancing

Returns
the estimated LB efficieny (only valid after balance() was called)

Definition at line 460 of file ALL.hpp.

+ Here is the caller graph for this function:

◆ getGamma()

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

method the get the correction value used in the balancing method

Returns
T the correction value for the balancing method

Definition at line 273 of file ALL.hpp.

+ Here is the caller graph for this function:

◆ getNeighbors()

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

method to provide a list of the ranks of the neighbors the local domain has in all directions

Returns
vector if neighboring ranks

Definition at line 442 of file ALL.hpp.

+ Here is the caller graph for this function:

◆ getNeighborVertices()

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

method to provide a list of neighboring vertices, e.g. required for VORONOI

Returns
vector of neighboring vertices neighboring vertices are stored in

Definition at line 448 of file ALL.hpp.

+ Here is the caller graph for this function:

◆ getPrevVertices()

template<class T, class W>
std::vector< Point< T > > & ALL::ALL< T, W >::getPrevVertices ( )
inline

get the vertices before performing the load-balancing step

Returns
std::vector<ALL::Point<T>> containing the vertices before the balancing step

Definition at line 415 of file ALL.hpp.

+ Here is the caller graph for this function:

◆ getVertices()

template<class T, class W>
std::vector< Point< T > > & ALL::ALL< T, W >::getVertices ( )
inline

get the resulting vertices after the load-balancing step, if it has been performed

Returns
std::vector<ALL::Point<T>> containing the resulting vertices after the balancing step

Definition at line 423 of file ALL.hpp.

+ Here is the caller graph for this function:

◆ getWork() [1/2]

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

method to get the work provided to the method

Returns
scalar work or first value of vector work

Definition at line 437 of file ALL.hpp.

◆ getWork() [2/2]

template<class T, class W>
void ALL::ALL< T, W >::getWork ( std::vector< W > & result)
inline

method to get the work provided to the method

Parameters
[out]resultreference to std::vector<W> to store the vector of work if an array of work was provided, e.g. for the histogram method

Definition at line 433 of file ALL.hpp.

+ Here is the caller graph for this function:

◆ printVTKoutlines()

template<class T, class W>
void ALL::ALL< T, W >::printVTKoutlines ( const int step)
inline

method to create VTK based output of the domains used in the load-balancing process (for now only orthogonal domains are supported)

Parameters
[in]stepthe number of the loadbalancing step used for numbering the output files

Definition at line 519 of file ALL.hpp.

+ Here is the caller graph for this function:

◆ printVTKvertices()

template<class T, class W>
void ALL::ALL< T, W >::printVTKvertices ( const int step)
inline

method to create VTK based output of the vertices used in the load-balancing process

Parameters
[in]stepthe number of the loadbalancing step used for numbering the output files

Definition at line 678 of file ALL.hpp.

+ Here is the caller graph for this function:

◆ setCommunicator()

template<class T, class W>
void ALL::ALL< T, W >::setCommunicator ( const MPI_Comm comm)
inline

method to set the communicator to be used in the balancing step, if a non cartesian communicator is provided, a cartesian communicator is created as a copy and used internally

Parameters
[in]commthe communicator to be used

Definition at line 211 of file ALL.hpp.

+ Here is the caller graph for this function:

◆ setGamma()

template<class T, class W>
void ALL::ALL< T, W >::setGamma ( const T g)
inline

method to set the correction value to be used in the balancing method

Parameters
[in]gthe correctin value to be used

Definition at line 277 of file ALL.hpp.

+ Here is the caller graph for this function:

◆ setMethodData()

template<class T, class W>
void ALL::ALL< T, W >::setMethodData ( const void * data)
inline

method to set method specific data, that is not required by all different balancing methods

Parameters
[in]datapointer to a struct or other data object in the format the methods requires

For the histogram method the number of bins per dimensions can be given as a C array of ints. The length of the array must be the number of dimensions given to the load balancer. BE CAREFUL this is not enforced!

Definition at line 486 of file ALL.hpp.

+ Here is the caller graph for this function:

◆ setMinDomainSize()

template<class T, class W>
void ALL::ALL< T, W >::setMinDomainSize ( const std::vector< T > & minSize)
inline

method the set the minimum domain sizes in all directions, can be required if using linked cell algorithms and wanting to prevent data exchange with next-near neighbors instead of only with next neighbors

Parameters
[in]minSizethe minimum size of a domain in each dimension

Definition at line 510 of file ALL.hpp.

+ Here is the caller graph for this function:

◆ setProcGridParams()

template<class T, class W>
void ALL::ALL< T, W >::setProcGridParams ( const std::vector< int > & loc,
const std::vector< int > & size )
inline

method to set the parameters of the used cartesian communicator

Parameters
[in]locthe cartesian coordinates of the local domain in the process grid
[in]sizethe size of the cartesian process grid

Definition at line 494 of file ALL.hpp.

+ Here is the caller graph for this function:

◆ setProcTag()

template<class T, class W>
void ALL::ALL< T, W >::setProcTag ( int tag)
inline

method to set the process tag output in VTK output

Parameters
[in]tag

Definition at line 504 of file ALL.hpp.

+ Here is the caller graph for this function:

◆ setSysSize()

template<class T, class W>
void ALL::ALL< T, W >::setSysSize ( const std::vector< T > & sysSize)
inline

method to set the size of the system, e.g. required for the HISTOGRAM balancing method

Parameters
[in]sysSizereference to a vector of T containing the size of the orthogonal system in the following format: (x_min, x_max, y_min, y_max, z_min, z_max)

Definition at line 474 of file ALL.hpp.

+ Here is the caller graph for this function:

◆ setup()

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

method to call the setup of the chosen balancing method (not all methods require a setup)

Definition at line 292 of file ALL.hpp.

+ Here is the caller graph for this function:

◆ setVertices()

template<class T, class W>
void ALL::ALL< T, W >::setVertices ( const std::vector< Point< T > > & inp)
inline

method to provide a new set of vertices

Parameters
[in]inpreference to a vector of ALL::Point objects describing the vertices to be used in the balancing step

Definition at line 195 of file ALL.hpp.

+ Here is the caller graph for this function:

◆ setWork() [1/2]

template<class T, class W>
void ALL::ALL< T, W >::setWork ( const std::vector< W > & work)
inline
Parameters
[in]workstd::vector<W> containing the work for the local domain

Definition at line 288 of file ALL.hpp.

◆ setWork() [2/2]

template<class T, class W>
void ALL::ALL< T, W >::setWork ( const W work)
inline

method to set a scalar work for the local domain

Parameters
[in]workthe scalar work for the local domain

Definition at line 281 of file ALL.hpp.

+ Here is the caller graph for this function:

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