Quantum 3xplorer (Q3)
An AI-native quantum simulation engine
Loading...
Searching...
No Matches
q3::PlanewaveMemoryEstimate Struct Reference

#include <memory_estimate.hpp>

Static Public Member Functions

static PlanewaveMemoryEstimate compute (const PlanewaveMemoryEstimateInputs &inputs)
 

Public Attributes

int maximum_basis_size = 0
 
std::uint64_t peak_bytes = 0
 
std::uint64_t setup_peak_bytes = 0
 The tallest point of setup, before the solver workspace exists.
 
std::uint64_t solver_bytes = 0
 What the solver workspace alone contributes to the steady state.
 
std::vector< PlanewaveMemoryEstimateTerm > steady_state
 
std::uint64_t steady_state_bytes = 0
 
std::vector< PlanewaveMemoryEstimateTerm > transient
 

Detailed Description

A footprint estimate: the terms that persist, the terms that only spike, and the totals a reader actually acts on.

Definition at line 61 of file memory_estimate.hpp.

Member Function Documentation

◆ compute()

PlanewaveMemoryEstimate q3::PlanewaveMemoryEstimate::compute ( const PlanewaveMemoryEstimateInputs &  inputs)
inlinestatic

The Davidson basis is sized by the GLOBAL band count, never by a rank's local range: band distribution splits the loops over these arrays, not the arrays themselves.

S|V> is stored only when S is not the identity. For norm-conserving runs it would be a verbatim copy of the basis, so the solver aliases the two and this term disappears.

One band-sized buffer, borrowed for the two rotations that cannot be done in place. The Ritz vectors, H|Ritz>, S|Ritz> and the residual array are gone: correction vectors are built straight into the free basis columns.

H and S in the subspace, the eigenvector matrix, and the copy of S the eigensolver is allowed to destroy; the Hamiltonian's copy is the eigenvector buffer itself. At Gamma the solver packs to real in place rather than into copies of its own.

The D matrix is block-diagonal by atom and is stored that way. As a dense nkb x nkb it was 967 MB on the 432-atom deck, of which 2 MB was nonzero. The estimate does not carry the per-atom channel count, so it uses the average, nkb^2 / nat.

The atomic-orbital start holds five arrays of max(natwfc, nb) columns at once. It is a spike, not a resident cost, but it is the tallest point of a small run and it is what an undersized allocation dies in.

The setup spike and the solver workspace never coexist: the initializer's arrays are gone by the time the first solve allocates. So the peak is the taller of the two phases, not their sum.

Definition at line 76 of file memory_estimate.hpp.

References q3::PlanewaveMemoryEstimateInputs::davidson_basis_expansion_factor, q3::PlanewaveMemoryEstimateInputs::diagonalizer_is_davidson, q3::PlanewaveMemoryEstimateInputs::fft_rho_grid_points, q3::PlanewaveMemoryEstimateInputs::fft_wave_grid_points, q3::PlanewaveMemoryEstimateInputs::local_number_of_kpoint_states, q3::PlanewaveMemoryEstimateInputs::max_plane_waves_per_kpoint, maximum_basis_size, q3::PlanewaveMemoryEstimateInputs::mixing_history_depth, q3::PlanewaveMemoryEstimateInputs::number_of_atomic_orbitals, q3::PlanewaveMemoryEstimateInputs::number_of_atoms, q3::PlanewaveMemoryEstimateInputs::number_of_bands, q3::PlanewaveMemoryEstimateInputs::number_of_g_vectors, q3::PlanewaveMemoryEstimateInputs::number_of_projectors, q3::PlanewaveMemoryEstimateInputs::number_of_spin_components, q3::PlanewaveMemoryEstimateInputs::overlap_is_identity, peak_bytes, setup_peak_bytes, solver_bytes, steady_state, steady_state_bytes, and transient.

Referenced by q3::PlanewavePseudopotentialKohnShamSCFIterator::report_memory_estimate().

Member Data Documentation

◆ maximum_basis_size

int q3::PlanewaveMemoryEstimate::maximum_basis_size = 0

Definition at line 70 of file memory_estimate.hpp.

Referenced by compute().

◆ peak_bytes

std::uint64_t q3::PlanewaveMemoryEstimate::peak_bytes = 0

◆ setup_peak_bytes

std::uint64_t q3::PlanewaveMemoryEstimate::setup_peak_bytes = 0

The tallest point of setup, before the solver workspace exists.

Definition at line 68 of file memory_estimate.hpp.

Referenced by compute().

◆ solver_bytes

std::uint64_t q3::PlanewaveMemoryEstimate::solver_bytes = 0

What the solver workspace alone contributes to the steady state.

Definition at line 66 of file memory_estimate.hpp.

Referenced by compute().

◆ steady_state

std::vector<PlanewaveMemoryEstimateTerm> q3::PlanewaveMemoryEstimate::steady_state

◆ steady_state_bytes

std::uint64_t q3::PlanewaveMemoryEstimate::steady_state_bytes = 0

◆ transient

std::vector<PlanewaveMemoryEstimateTerm> q3::PlanewaveMemoryEstimate::transient

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