Skip to content
Snippets Groups Projects

Refactor

1 file
+ 45
13
Compare changes
  • Side-by-side
  • Inline
+ 45
13
@@ -28,7 +28,7 @@ in work of the neighboring domains, is computed and the
@@ -28,7 +28,7 @@ in work of the neighboring domains, is computed and the
vertex is shifted in a way to equalize the work between these
vertex is shifted in a way to equalize the work between these
neighboring domains.
neighboring domains.
- [o] Voronoi Mesh:
- [w] Voronoi Mesh:
Similar to the topological mesh method, this method computes a
Similar to the topological mesh method, this method computes a
force, based on work differences. In contrast to the topological mesh
force, based on work differences. In contrast to the topological mesh
method, the force acts on a Voronoi point rather than a vertex, i.e. a
method, the force acts on a Voronoi point rather than a vertex, i.e. a
@@ -69,11 +69,15 @@ Installation & Requirements:
@@ -69,11 +69,15 @@ Installation & Requirements:
Base requirements:
Base requirements:
C++11
C++11
MPI
MPI
CMake 3.1+
CMake 3.10+
Optional requirements:
Optional requirements:
Fortran 2003
Fortran 2003
 
Fortran 2008 (if the more modern Fortran MPI interface is to be used)
VTK 7.1+ (for VTK-based output of the domains)
VTK 7.1+ (for VTK-based output of the domains)
 
Boost testing utilities
 
Doxygen
 
Sphinx (with breathe extension)
Installation:
Installation:
@@ -95,6 +99,10 @@ Installation & Requirements:
@@ -95,6 +99,10 @@ Installation & Requirements:
compiles the Fortran interface and example
compiles the Fortran interface and example
-DCM_ALL_VORONOI=ON/OFF [default: OFF]
-DCM_ALL_VORONOI=ON/OFF [default: OFF]
activates the compilation of the Voronoi-mesh scheme (and the compilation of Voro++)
activates the compilation of the Voronoi-mesh scheme (and the compilation of Voro++)
 
-DCM_ALL_USE_F08=ON/OFF [default: OFF]
 
activates the Fortran 2008 MPI interface
 
-DCM_ALL_TESTING=ON/OFF [default: OFF]
 
activates unit tests, which can be run with make test
3.) Execute make to compile and install the library to the previously set
3.) Execute make to compile and install the library to the previously set
directory:
directory:
@@ -130,11 +138,7 @@ Usage:
@@ -130,11 +138,7 @@ Usage:
ALL_Point<T>( const int dimension, const T* values )
ALL_Point<T>( const int dimension, const T* values )
ALL_Point<T>( const std::vector<T>& values )
ALL_Point<T>( const std::vector<T>& values )
void ALL_Point<T>::set_coordinates( const T* values )
T& ALL_Point<T>::operator[]( const int index )
void ALL_Point<T>::set_coordinates( const std::vector<T> values )
void ALL_Point<T>::set_coordinate(const int idx, const T& values )
T ALL_Point<T>::x(int index)
ALL_Point is a class describing a point in space, where the dimension of the space is given
ALL_Point is a class describing a point in space, where the dimension of the space is given
by the input parameter. It can be initialized by either using an array of datatype T or a
by the input parameter. It can be initialized by either using an array of datatype T or a
@@ -142,12 +146,8 @@ Usage:
@@ -142,12 +146,8 @@ Usage:
of the point is derived from the length of the std::vector. For the initialization with an
of the point is derived from the length of the std::vector. For the initialization with an
array the user has to check that the passed array is of sufficient length, i.e. of length
array the user has to check that the passed array is of sufficient length, i.e. of length
dimension (or longer).
dimension (or longer).
To update initialized ALL_Point objects, either all coordinates can be updated with the use
To update or access initialized ALL_Point objects, the [] operator is overloaded and the n-th
of the set_coordinates methods, using either an array of data type T or a std::vector<T> as
component of a ALL_Point object ?p? can be updated or accessed by p[n].
source for the new values. Like before in the case of the array, the user has to check for
correctness of the array before passing it to the object. Single coordinates can be modified
with the use of the set_coordinate method, while coordinate values can be accessed with the
ALL_Point<T>::x method.
2.) Setup basic parameters of the system:
2.) Setup basic parameters of the system:
@@ -183,6 +183,7 @@ Usage:
@@ -183,6 +183,7 @@ Usage:
ALL_LB_t::TENSOR
ALL_LB_t::TENSOR
ALL_LB_t::STAGGERED
ALL_LB_t::STAGGERED
 
ALL_LB_t::HISTOGRAM
With the keyword method the load balancing strategy is chosen, given by the list above. Starting
With the keyword method the load balancing strategy is chosen, given by the list above. Starting
point for all methods, described below is a given domain structure (e.g. the one which is initially
point for all methods, described below is a given domain structure (e.g. the one which is initially
@@ -245,6 +246,37 @@ Usage:
@@ -245,6 +246,37 @@ Usage:
- communication pattern in the calling code might require adjustment to deal
- communication pattern in the calling code might require adjustment to deal
with changing neighbors
with changing neighbors
 
ALL_LB_t::HISTOGRAM:
 
 
The histogram-based method works differently than the first two methods in such a way, that it is a
 
global method that requires three distinct steps for a single adjustment. In each of these steps
 
the following takes place: a partial histogram needs to be created over the workload, e.g. number of particles,
 
along one direction on each domain, then these are supplied to the method, where a global histogram
 
is computed. With this global histogram a distribution function is created. This is used to compute the optimal
 
(possible) width of domains in that direction. For the second and third steps the computation of the global
 
histograms and distribution functions take place in subsystems, being the results of the previous step.
 
The result is the most optimal distribution of domains according to the Staggered-grid method, at the cost of
 
global exchange of work, due to the global adjustment, which makes the method not well suited to highly dynamic
 
systems, due to the need of frequent updates. On the other hand the method is well suited for static problems,
 
e.g. grid-based simulations.
 
 
Note: Currently the order of dimensions is: z-y-x.
 
 
Required number of vertices:
 
two, one describing the lower left front point and one describing the
 
upper right back point of the domain
 
 
Additional requirements:
 
partial histogram created over the workload on the local domain in the direction of the current correction step
 
 
Advantages:
 
- supplies an optimal distribution of domains (restricted by width of bins used for the histogram)
 
- only three steps needed to acquire result
 
 
Disadvantages:
 
- expensive in cost of communication, due to global shifts
 
- requires preparation of histogram and shift of work between each of the three correction steps
 
4.) Computing new boundaries / vertices
4.) Computing new boundaries / vertices
void ALL<T,W>::balance(short method)
void ALL<T,W>::balance(short method)
Loading