Loading...
Searching...
No Matches
q3::execution::PlanewaveSerialExecutionPolicy Class Reference

#include <serial.hpp>

+ Inheritance diagram for q3::execution::PlanewaveSerialExecutionPolicy:

Public Member Functions

std::vector< Real > assemble_global_kpoint_state_data (const std::vector< Real > &local_data, int, int, int) const override
 
std::unique_ptr< FFTGrid > create_fft_grid () const override
 
bool each_process_owns_whole_kpoints () const override
 The single process holds every k-point whole.
 
int global_kpoint_index (int local_kpoint_index) const override
 Identity: the single process holds the global k-point grid in order.
 
KPointsGrid local_kpoint_grid (const KPointsGrid &global_kpoint_grid) const override
 
int number_of_pools () const override
 
bool one_process_owns_complete_state () const override
 
void reduce_band_group_scalar_min (int &) const override
 
void reduce_charge_density (std::vector< std::vector< Real > > &) const override
 
void reduce_scalar (Real &) const override
 
void reduce_scalar_max (int &) const override
 
void reduce_scalar_max (Real &) const override
 
void reduce_scalar_min (Real &) const override
 
void reduce_vector (std::vector< Real > &) const override
 
void reduce_within_pool_scalar (Real &) const override
 
void reduce_within_pool_vector (std::vector< Real > &) const override
 
- Public Member Functions inherited from q3::execution::SerialExecutionPolicy
void add_scaled_vector (int number_of_elements, ComplexValue scaling_factor, const ComplexValue *vector_x, ComplexValue *vector_y) const override
 
void allgather_within_group (const Real *local_data, int local_count, Real *full_data, int) const override
 
ComplexValue dot_product (int number_of_elements, const ComplexValue *vector_x, const ComplexValue *vector_y) const override
 
int global_number_of_elements (int local_number_of_elements) const override
 
int group_rank_index () const override
 
int group_size () const override
 
bool is_root () const override
 
Real norm (int number_of_elements, const ComplexValue *vector_x) const override
 
int number_of_processes () const override
 
void reduce_within_group (ComplexValue *, int) const override
 
void reduce_within_group (Real *, int) const override
 
- Public Member Functions inherited from q3::execution::ExecutionPolicy
virtual ~ExecutionPolicy ()=default
 
virtual void allgather_across_bands (ComplexValue *, const int *, const int *) const
 
virtual int band_distribution_rank_index () const
 
virtual int band_distribution_size () const
 
virtual void broadcast_across_bands (ComplexValue *, int) const
 
virtual void broadcast_across_bands (int *, int) const
 Integer overload, for the counts that decide collective sizes.
 
virtual void broadcast_across_bands (Real *, int) const
 Real overload, for eigenvalues – the numbers convergence decisions are made from.
 
virtual void broadcast_from_group_root (ComplexValue *, int) const
 
virtual void broadcast_from_group_root (Real *, int) const
 
virtual void reduce_across_bands (Real *, int) const
 
virtual void reduce_group_distributed_result (ComplexValue *, int) const
 
- Public Member Functions inherited from q3::execution::PlanewaveExecutionPolicy
 ~PlanewaveExecutionPolicy () override=default
 
virtual void disable_band_distribution ()
 
generated::ResultsExecution execution_record () const
 
virtual bool number_of_pools_was_requested () const
 
virtual void reconfigure_topology (int)
 
- Public Member Functions inherited from q3::execution::QuantumSystemExecutionPolicy
 ~QuantumSystemExecutionPolicy () override=default
 
int band_rank_index () const
 
int band_size () const
 
- Public Member Functions inherited from q3::FFTGridFactory
virtual ~FFTGridFactory ()=default
 

Additional Inherited Members

- Public Types inherited from q3::execution::ExecutionPolicy
using ComplexValue = Complex
 

Detailed Description

Definition at line 18 of file serial.hpp.

Member Function Documentation

◆ assemble_global_kpoint_state_data()

std::vector< Real > q3::execution::PlanewaveSerialExecutionPolicy::assemble_global_kpoint_state_data ( const std::vector< Real > &  local_data,
int  local_number_of_physical_kpoints,
int  number_of_spin_components,
int  number_of_values_per_state 
) const
inlineoverridevirtual

Assemble fixed-width data for local k-point states into global order.

Local state order is spin-major, with physical k-points ordered as they appear in local_kpoint_grid(). The returned data uses the same spin-major convention over the complete global grid. Serial policies return the input unchanged; MPI policies gather one contribution per pool.

Implements q3::execution::PlanewaveExecutionPolicy.

Definition at line 69 of file serial.hpp.

◆ create_fft_grid()

std::unique_ptr< FFTGrid > q3::execution::PlanewaveSerialExecutionPolicy::create_fft_grid ( ) const
inlineoverridevirtual

Create a new FFT grid instance appropriate for the active execution configuration (serial, MPI slab-decomposed, ...).

Implements q3::FFTGridFactory.

Definition at line 76 of file serial.hpp.

◆ each_process_owns_whole_kpoints()

bool q3::execution::PlanewaveSerialExecutionPolicy::each_process_owns_whole_kpoints ( ) const
inlineoverridevirtual

The single process holds every k-point whole.

Implements q3::execution::PlanewaveExecutionPolicy.

Definition at line 36 of file serial.hpp.

◆ global_kpoint_index()

int q3::execution::PlanewaveSerialExecutionPolicy::global_kpoint_index ( int  local_kpoint_index) const
inlineoverridevirtual

Identity: the single process holds the global k-point grid in order.

Implements q3::execution::PlanewaveExecutionPolicy.

Definition at line 40 of file serial.hpp.

◆ local_kpoint_grid()

KPointsGrid q3::execution::PlanewaveSerialExecutionPolicy::local_kpoint_grid ( const KPointsGrid &  global_kpoint_grid) const
inlineoverridevirtual

Identity: return the global grid unchanged.

Implements q3::execution::PlanewaveExecutionPolicy.

Definition at line 64 of file serial.hpp.

◆ number_of_pools()

int q3::execution::PlanewaveSerialExecutionPolicy::number_of_pools ( ) const
inlineoverridevirtual

Band-group ops inherited from SerialExecutionPolicy: dot_product, add_scaled_vector, norm No-op: single process already holds the full charge density.

Implements q3::execution::PlanewaveExecutionPolicy.

Definition at line 29 of file serial.hpp.

◆ one_process_owns_complete_state()

bool q3::execution::PlanewaveSerialExecutionPolicy::one_process_owns_complete_state ( ) const
inlineoverridevirtual

Whether one process owns every k-point and every G-vector coefficient.

Writers without a gather implementation may serialize state only when this is true. It is stronger than checking the current group size because a small-basis fallback can disable coefficient distribution without turning a multi-process FFT grid into a serial one.

Implements q3::execution::PlanewaveExecutionPolicy.

Definition at line 32 of file serial.hpp.

◆ reduce_band_group_scalar_min()

void q3::execution::PlanewaveSerialExecutionPolicy::reduce_band_group_scalar_min ( int &  value) const
inlineoverridevirtual

Reduce an integer scalar within the band group using MPI_MIN.

Used during initialization to check if any rank in the pool received zero plane waves from slab distribution.

Parameters
valueIn-out: local value, replaced by band-group minimum.

Implements q3::execution::PlanewaveExecutionPolicy.

Definition at line 53 of file serial.hpp.

◆ reduce_charge_density()

void q3::execution::PlanewaveSerialExecutionPolicy::reduce_charge_density ( std::vector< std::vector< Real > > &  ) const
inlineoverridevirtual

Implements q3::execution::PlanewaveExecutionPolicy.

Definition at line 43 of file serial.hpp.

◆ reduce_scalar()

void q3::execution::PlanewaveSerialExecutionPolicy::reduce_scalar ( Real &  ) const
inlineoverridevirtual

No-op: single process already holds the full scalar value.

Implements q3::execution::PlanewaveExecutionPolicy.

Definition at line 48 of file serial.hpp.

◆ reduce_scalar_max() [1/2]

void q3::execution::PlanewaveSerialExecutionPolicy::reduce_scalar_max ( int &  value) const
inlineoverridevirtual

Reduce a scalar across all pools using MPI_MAX.

Used for summary statistics such as max_plane_waves_per_kpoint where each pool holds only its local k-points and the global maximum is needed.

Parameters
valueIn-out: local maximum, replaced by global maximum.

Implements q3::execution::PlanewaveExecutionPolicy.

Definition at line 50 of file serial.hpp.

◆ reduce_scalar_max() [2/2]

void q3::execution::PlanewaveSerialExecutionPolicy::reduce_scalar_max ( Real &  value) const
inlineoverridevirtual

Reduce a Real scalar across all pools using MPI_MAX.

Used for global eigenvalue range (e.g., HOMO across pools).

Parameters
valueIn-out: local maximum, replaced by global maximum.

Implements q3::execution::PlanewaveExecutionPolicy.

Definition at line 51 of file serial.hpp.

◆ reduce_scalar_min()

void q3::execution::PlanewaveSerialExecutionPolicy::reduce_scalar_min ( Real &  value) const
inlineoverridevirtual

Reduce a Real scalar across all pools using MPI_MIN.

Used for global eigenvalue range (e.g., LUMO across pools).

Parameters
valueIn-out: local minimum, replaced by global minimum.

Implements q3::execution::PlanewaveExecutionPolicy.

Definition at line 52 of file serial.hpp.

◆ reduce_vector()

void q3::execution::PlanewaveSerialExecutionPolicy::reduce_vector ( std::vector< Real > &  values) const
inlineoverridevirtual

Reduce a vector of k-point-local values across all pools (MPI_SUM).

Used for nonlocal forces and kinetic/nonlocal stress contributions.

Parameters
valuesIn-out: local k-point contributions, replaced by global sum.

Implements q3::execution::PlanewaveExecutionPolicy.

Definition at line 49 of file serial.hpp.

◆ reduce_within_pool_scalar()

void q3::execution::PlanewaveSerialExecutionPolicy::reduce_within_pool_scalar ( Real &  ) const
inlineoverridevirtual

No-op: single process owns all grid slabs (no slab decomposition).

Implements q3::execution::PlanewaveExecutionPolicy.

Definition at line 58 of file serial.hpp.

◆ reduce_within_pool_vector()

void q3::execution::PlanewaveSerialExecutionPolicy::reduce_within_pool_vector ( std::vector< Real > &  values) const
inlineoverridevirtual

Reduce a real-space slab integral vector within this pool (MPI_SUM).

Used for local forces, XC stress, local-PP stress, and core-correction forces/stress computed from real-space grid slabs.

Parameters
valuesIn-out: partial slab contributions, replaced by pool-total.

Implements q3::execution::PlanewaveExecutionPolicy.

Definition at line 59 of file serial.hpp.


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