Loading...
Searching...
No Matches
q3::FFTStickPartition Class Reference

#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.
 

Detailed Description

Definition at line 34 of file stick_partition.hpp.

Member Function Documentation

◆ build()

void q3::FFTStickPartition::build ( int  dimension_1,
int  dimension_2,
const std::vector< int > &  stick_weights,
int  number_of_ranks 
)
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().

◆ imbalance()

double q3::FFTStickPartition::imbalance ( ) const
inline

Heaviest rank's share divided by the lightest; 1.0 is a perfect split.

Definition at line 134 of file stick_partition.hpp.

◆ number_of_ranks()

int q3::FFTStickPartition::number_of_ranks ( ) const
inline

Definition at line 145 of file stick_partition.hpp.

Referenced by build().

◆ owner()

const std::vector< int > & q3::FFTStickPartition::owner ( ) const
inline

Definition at line 125 of file stick_partition.hpp.

◆ owner_of()

int q3::FFTStickPartition::owner_of ( int  wrapped_first,
int  wrapped_second 
) const
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().

◆ owner_of_miller()

int q3::FFTStickPartition::owner_of_miller ( int  miller_1,
int  miller_2 
) const
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().

◆ weight_per_rank()

const std::vector< long long > & q3::FFTStickPartition::weight_per_rank ( ) const
inline

Definition at line 129 of file stick_partition.hpp.

◆ wrap()

static int q3::FFTStickPartition::wrap ( int  miller,
int  dimension 
)
inlinestatic

Definition at line 149 of file stick_partition.hpp.

Referenced by q3::FFTGridSticks::g_vector_to_fft_grid_index().

Member Data Documentation

◆ unassigned

constexpr int q3::FFTStickPartition::unassigned = -1
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().


The documentation for this class was generated from the following file: