Loading...
Searching...
No Matches
q3::parallel::KPointDistributor Class Reference

#include <kpoint_distributor.hpp>

Public Member Functions

 KPointDistributor (const KPointsGrid &global_kpoint_grid, int pool_index, int number_of_pools)
 
const KPointsGrid & local_kpoint_grid () const
 
const std::vector< int > & local_to_global_kpoint_map () const
 
int number_of_local_kpoints () const
 
int number_of_pools () const
 
int pool_index () const
 

Detailed Description

Definition at line 25 of file kpoint_distributor.hpp.

Constructor & Destructor Documentation

◆ KPointDistributor()

q3::parallel::KPointDistributor::KPointDistributor ( const KPointsGrid &  global_kpoint_grid,
int  pool_index,
int  number_of_pools 
)
inline

Distribute k-points across pools.

Parameters
global_kpoint_gridThe full IBZ k-point grid.
pool_indexZero-based index of this pool.
number_of_poolsTotal number of pools.

Preserve the original grid metadata (dimensions and shifts) so that downstream gamma-only detection (grid == 1×1×1, no shift) still works on the distributed local grid.

Definition at line 34 of file kpoint_distributor.hpp.

References q3::KPointsGrid::add_kpoint(), q3::KPointsGrid::grid_dimensions(), q3::KPointsGrid::grid_shifts(), q3::KPointsGrid::number_of_kpoints(), number_of_pools(), pool_index(), and q3::KPointsGrid::set_grid_metadata().

Member Function Documentation

◆ local_kpoint_grid()

const KPointsGrid & q3::parallel::KPointDistributor::local_kpoint_grid ( ) const
inline

The local k-point grid assigned to this pool.

Weights are preserved from the global grid. The sum of weights across all pools equals the sum of global weights.

Definition at line 68 of file kpoint_distributor.hpp.

Referenced by q3::execution::PlanewaveMPIExecutionPolicy::local_kpoint_grid().

◆ local_to_global_kpoint_map()

const std::vector< int > & q3::parallel::KPointDistributor::local_to_global_kpoint_map ( ) const
inline

Maps local k-point index → global k-point index.

Used to reassemble eigenvalues from all pools into the global ordering expected by results.json.

Definition at line 78 of file kpoint_distributor.hpp.

◆ number_of_local_kpoints()

int q3::parallel::KPointDistributor::number_of_local_kpoints ( ) const
inline

Definition at line 82 of file kpoint_distributor.hpp.

◆ number_of_pools()

int q3::parallel::KPointDistributor::number_of_pools ( ) const
inline

Definition at line 89 of file kpoint_distributor.hpp.

Referenced by KPointDistributor().

◆ pool_index()

int q3::parallel::KPointDistributor::pool_index ( ) const
inline

Definition at line 86 of file kpoint_distributor.hpp.

Referenced by KPointDistributor().


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