IPPL (Independent Parallel Particle Layer)
IPPL
Loading...
Searching...
No Matches
OrthogonalRecursiveBisection.h
Go to the documentation of this file.
1//
2// Class OrthogonalRecursiveBisection for Domain Decomposition
3//
4// Simple domain decomposition using an Orthogonal Recursive Bisection,
5// domain is divided recursively so as to even weights on each side of the cut,
6// works with 2^n processors only.
7//
8//
9
10#ifndef IPPL_ORTHOGONAL_RECURSIVE_BISECTION_H
11#define IPPL_ORTHOGONAL_RECURSIVE_BISECTION_H
12
14#include "Index/Index.h"
15#include "Index/NDIndex.h"
18#include "Region/NDRegion.h"
19
20namespace ippl {
21 /*
22 * @class OrthogonalRecursiveBisection
23 * @tparam Field the field type
24 * @tparam Tp type of particle position. If not specified, it will be equal to the field's type
25 */
26
27 template <class Field, class Tp = typename Field::value_type>
29 constexpr static unsigned Dim = Field::dim;
30 using mesh_type = typename Field::Mesh_t;
31 using Tf = typename Field::value_type;
32
33 public:
34 // Weight for reduction
36
43 void initialize(FieldLayout<Dim>& fl, mesh_type& mesh, const Field& rho);
44
54 template <typename Attrib>
55 bool binaryRepartition(const Attrib& R, FieldLayout<Dim>& fl,
56 const bool& isFirstRepartition);
57
63
71 void perpendicularReduction(std::vector<Tf>& rankWeights, unsigned int cutAxis,
72 NDIndex<Dim>& dom);
73
78 int findMedian(std::vector<Tf>& w);
79
89 void cutDomain(std::vector<NDIndex<Dim>>& domains, std::vector<int>& procs, int it,
90 int cutAxis, int median);
91
98 template <typename Attrib>
99 void scatterR(const Attrib& r);
100
101 }; // class
102
103} // namespace ippl
104
106
107#endif // IPPL_ORTHOGONAL_RECURSIVE_BISECTION_H
Definition Archive.h:20
void cutDomain(std::vector< NDIndex< Dim > > &domains, std::vector< int > &procs, int it, int cutAxis, int median)
void initialize(FieldLayout< Dim > &fl, mesh_type &mesh, const Field &rho)
void perpendicularReduction(std::vector< Tf > &rankWeights, unsigned int cutAxis, NDIndex< Dim > &dom)
bool binaryRepartition(const Attrib &R, FieldLayout< Dim > &fl, const bool &isFirstRepartition)