ALL class

template<class T, class W>
class ALL
Template Parameters:
  • T – data type for vertices and related data

  • W – data type for work and related data

Public Functions

inline ALL()

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

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

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:
  • m[in] the balancing method to be used

  • d[in] the dimension of the vertices to be used (most methods currently only support 3D vertices)

  • inp[in] the set of vertices to be used in the balancing step

  • g[in] the value used for the correction value, if required by the chosen balancing method

inline ALL(const LB_t m, const int d, const T g)

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:
  • m[in] the balancing method to be used

  • d[in] the dimension of the vertices to be used (most methods currently only support 3D vertices)

  • g[in] the value used for the correction value, if required by the chosen balancing method

~ALL() = default

destructor

inline std::vector<Point<T>> &balance()

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

Parameters:

internal[in] toggles 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

inline int getDimension()

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

inline W getEfficiency()

method to provide the current load-balancing efficiency

Returns:

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

inline W getEstimatedEfficiency()

method to provide an estimated work efficiency after the balancing

Returns:

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

inline T getGamma()

method the get the correction value used in the balancing method

Returns:

T the correction value for the balancing method

inline std::vector<int> &getNeighbors()

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

Returns:

vector if neighboring ranks

inline std::vector<T> &getNeighborVertices()

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

Returns:

vector of neighboring vertices neighboring vertices are stored in

inline std::vector<Point<T>> &getPrevVertices()

get the vertices before performing the load-balancing step

Returns:

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

inline std::vector<Point<T>> &getVertices()

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

inline W getWork()

method to get the work provided to the method

Returns:

scalar work or first value of vector work

inline void getWork(std::vector<W> &result)

method to get the work provided to the method

Parameters:

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

inline void printVTKoutlines(const int step)

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

Parameters:

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

inline void printVTKvertices(const int step)

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

Parameters:

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

inline void setCommunicator(const MPI_Comm comm)

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:

comm[in] the communicator to be used

inline void setGamma(const T g)

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

Parameters:

g[in] the correctin value to be used

inline void setMethodData(const void *data)

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

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!

Parameters:

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

inline void setMinDomainSize(const std::vector<T> &minSize)

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:

minSize[in] the minimum size of a domain in each dimension

inline void setProcGridParams(const std::vector<int> &loc, const std::vector<int> &size)

method to set the parameters of the used cartesian communicator

Parameters:
  • loc[in] the cartesian coordinates of the local domain in the process grid

  • size[in] the size of the cartesian process grid

inline void setProcTag(int tag)

method to set the process tag output in VTK output

Parameters:

tag[in]

inline void setSysSize(const std::vector<T> &sysSize)

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

Parameters:

sysSize[in] reference 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)

inline void setup()

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

inline void setVertices(const std::vector<Point<T>> &inp)

method to provide a new set of vertices

Parameters:

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

inline void setWork(const std::vector<W> &work)
Parameters:

work[in] std::vector<W> containing the work for the local domain

inline void setWork(const W work)

method to set a scalar work for the local domain

Parameters:

work[in] the scalar work for the local domain