77 const std::uint64_t complex_size = 16;
78 const std::uint64_t real_size = 8;
79 const std::uint64_t bands =
static_cast<std::uint64_t
>(inputs.
number_of_bands);
99 auto add_steady = [&estimate](
const std::string& label,
100 const std::string& formula,
102 bool belongs_to_solver =
false) {
106 estimate.
steady_state.push_back({label, formula, bytes});
108 if (belongs_to_solver) {
113 [&estimate](
const std::string& label,
const std::string& formula, std::uint64_t bytes) {
117 estimate.
transient.push_back({label, formula, bytes});
121 add_steady(
"Davidson basis V, HV",
123 2 * basis * plane_waves * complex_size,
132 "Davidson basis SV",
"M x npw x 16", basis * plane_waves * complex_size,
true);
140 add_steady(
"rotation scratch",
"nb x npw x 16", bands * plane_waves * complex_size,
true);
143 "Ritz overlap vectors",
"nb x npw x 16", bands * plane_waves * complex_size,
true);
151 add_steady(
"subspace matrices",
"4 x M^2 x 16", 4 * basis * basis * complex_size,
true);
154 add_steady(
"wavefunctions",
155 "nkstates x nb x npw x 16",
157 plane_waves * complex_size);
158 add_steady(
"nonlocal projectors",
"nkb x npw x 16", projectors * plane_waves * complex_size);
166 add_steady(
"block-diagonal D matrix",
168 projectors * projectors /
static_cast<std::uint64_t
>(inputs.
number_of_atoms) *
171 add_steady(
"Broyden history",
172 "3 x ndim x nspin x ngm x 16",
175 add_steady(
"G-vector table",
"ngm x 80", g_vectors * 80);
176 add_steady(
"FFT buffers",
177 "2 x (Nrho + 2 x Nwave) x 16",
182 add_steady(
"density and potential",
183 "(4 + 3 x nspin) x Nrho x 8",
192 std::uint64_t starting_columns =
static_cast<std::uint64_t
>(
195 add_transient(
"wavefunction initialization",
196 "5 x max(natwfc, nb) x npw x 16",
197 5 * starting_columns * plane_waves * complex_size);
204 std::uint64_t largest_transient = 0;
205 for (
const auto& term : estimate.
transient) {
206 if (term.bytes > largest_transient) {
207 largest_transient = term.bytes;