ALL class

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

Template Parameters
  • T: data type for vertices and related data

  • W: data type for work and related data

Public Functions

ALL()

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

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

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

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

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

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

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

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

~ALL() = default

destructor

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

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

Return

std::vector<ALL::Point<T>> containing the shifted set of vertices

Parameters
  • [in] internal: toggles if internal steps are performed, needed for some recursive calls of the routine by some methods

int getDimension()

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

Return

int containing the dimension of the vertices

T getGamma()

method the get the correction value used in the balancing method

Return

T the correction value for the balancing method

std::vector<int> &getNeighbors()

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

Return

vector if neighboring ranks

std::vector<T> &getNeighborVertices()

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

Return

vector of neighboring vertices neighboring vertices are stored in

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

get the vertices before performing the load-balancing step

Return

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

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

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

Return

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

W getWork()

method to get the work provided to the method

Return

scalar work or first value of vector work

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

method to get the work provided to the method

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

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
  • [in] step: the number of the loadbalancing step used for numbering the output files

void printVTKvertices(const int step)

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

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

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
  • [in] comm: the communicator to be used

void setGamma(const T g)

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

Parameters
  • [in] g: the correctin value to be used

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
  • [in] data: pointer to a struct or other data object in the format the methods requires

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
  • [in] minSize: the minimum size of a domain in each dimension

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

method to set the parameters of the used cartesian communicator

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

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

void setProcTag(int tag)

method to set the process tag output in VTK output

Parameters
  • [in] tag:

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

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

Parameters
  • [in] sysSize: 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)

void setup()

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

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

method to provide a new set of vertices

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

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

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

void setWork(const W work)

method to set a scalar work for the local domain

Parameters
  • [in] work: the scalar work for the local domain