#include <stick_partition.hpp>
Public Member Functions | |
| void | build (int dimension_1, int dimension_2, const std::vector< int > &stick_weights, int number_of_ranks) |
| double | imbalance () const |
| Heaviest rank's share divided by the lightest; 1.0 is a perfect split. | |
| int | number_of_ranks () const |
| const std::vector< int > & | owner () const |
| int | owner_of (int wrapped_first, int wrapped_second) const |
Rank owning the stick at wrapped indices, or unassigned if empty. | |
| int | owner_of_miller (int miller_1, int miller_2) const |
| Rank owning the stick carrying this G-vector, by signed Miller indices. | |
| const std::vector< long long > & | weight_per_rank () const |
Static Public Member Functions | |
| static int | wrap (int miller, int dimension) |
Static Public Attributes | |
| static constexpr int | unassigned = -1 |
| Sticks with no G-vectors inside the cutoff belong to nobody. | |
Definition at line 34 of file stick_partition.hpp.
|
inline |
Deal sticks onto ranks, mirror pairs together, heaviest pair first.
stick_weights is indexed by wrapped_first * dimension_2 + wrapped_second and holds the number of G-vectors on that stick; zero means the stick is outside the cutoff everywhere and is left unassigned.
Group sticks into mirror pairs before weighing them. A pair is assigned as a unit, so that -G is always on the rank that holds G. Sticks that are their own mirror – the origin row, and the Nyquist rows on even grids – stand alone.
Longest-first onto the least-loaded rank. Ties break on the stick index so the assignment is identical on every rank and between runs – ranks build this independently and must agree exactly.
Definition at line 46 of file stick_partition.hpp.
References number_of_ranks(), and unassigned.
Referenced by q3::FFTGridSticks::assign_sticks().
|
inline |
Heaviest rank's share divided by the lightest; 1.0 is a perfect split.
Definition at line 134 of file stick_partition.hpp.
|
inline |
Definition at line 145 of file stick_partition.hpp.
Referenced by build().
|
inline |
Definition at line 125 of file stick_partition.hpp.
|
inline |
Rank owning the stick at wrapped indices, or unassigned if empty.
Definition at line 116 of file stick_partition.hpp.
Referenced by q3::FFTGridSticks::assign_sticks().
|
inline |
Rank owning the stick carrying this G-vector, by signed Miller indices.
Definition at line 121 of file stick_partition.hpp.
Referenced by q3::FFTGridSticks::owns_stick().
|
inline |
Definition at line 129 of file stick_partition.hpp.
|
inlinestatic |
Definition at line 149 of file stick_partition.hpp.
Referenced by q3::FFTGridSticks::g_vector_to_fft_grid_index().
|
staticconstexpr |
Sticks with no G-vectors inside the cutoff belong to nobody.
Definition at line 37 of file stick_partition.hpp.
Referenced by q3::FFTGridSticks::assign_sticks(), and build().