144 log::debug(
" Estimated memory per rank (arrays only, replicated when bands "
145 "are distributed):");
148 " {:<38} {:<32} = {}", term.label, term.formula, format_bytes(term.bytes));
154 for (
const auto& term : estimate.
transient) {
158 format_bytes(term.bytes));
161 "estimated peak per rank",
174 log::debug(
" (arrays as allocated; compare with the measured peak at end of run)");
182 log::info(
" Q3 - Plane-wave DFT SCF Solver");
183 log::info(
" ================================");
190 log::info(
" FFT grid (rho) = {} x {} x {}",
194 log::info(
" FFT grid (wave) = {} x {} x {}",
203 log::info(
" spin polarization = LSDA (number_of_spin_components=2)");
223 const int ranks_per_pool =
227 log::info(
" MPI ranks = {} ({} pool(s) x {} rank(s) per pool)",
238 log::info(
" G-vector distribution = replicated (bands divided across the "
241 log::info(
" G-vector distribution = replicated (fallback: a rank's FFT "
242 "slab held no plane waves; every rank in a pool repeats "
246 " G-vector distribution = slab-distributed across the band group");
248 log::info(
" G-vector distribution = replicated (one rank per pool)");
257 log::info(
" mixing mode = {} (beta={:.2f})",
263 log::info(
" Davidson basis = {} x {} bands = {} vectors",
273 " Density symmetrization = {} shells from {} G-vectors ({} symmetry ops)",
290 log::info(
" iteration # {:3d} Etot = {:14.9f} Ry", 1, total_energy);
292 log::debug(
" double counting correction = {:.8f}",
304 report_magnetization(summary);
305 report_eigenvalues(summary);
306 report_final_energies(*summary.
energies);
317 static std::string format_bytes(std::uint64_t bytes) {
319 double gibibytes =
static_cast<double>(bytes) / 1073741824.0;
320 if (gibibytes < 1.0) {
321 std::snprintf(buffer,
sizeof(buffer),
"%8.1f MiB", gibibytes * 1024.0);
323 std::snprintf(buffer,
sizeof(buffer),
"%8.2f GiB", gibibytes);
325 return std::string(buffer);
328 static void report_magnetization(
const PlanewaveKohnShamSCFConvergenceSummary& summary) {
329 if (summary.number_of_spin_components != 2) {
341 log::info(
" total magnetization = {:.4f} Bohr mag/cell", summary.total_magnetization);
342 log::info(
" absolute magnetization = {:.4f} Bohr mag/cell",
343 summary.absolute_magnetization);
346 static void report_eigenvalues(
const PlanewaveKohnShamSCFConvergenceSummary& summary) {
347 int number_of_kpoint_states = summary.number_of_kpoints * summary.number_of_spin_components;
356 int number_of_states_to_print = number_of_kpoint_states;
357 log::section(
"Eigenvalues (eV), " + std::to_string(number_of_kpoint_states) +
358 " k-point state(s):");
359 for (
int kpoint_index_state = 0; kpoint_index_state < number_of_states_to_print;
360 ++kpoint_index_state) {
361 int spin_index = kpoint_index_state / summary.number_of_kpoints;
362 int kpoint_index = kpoint_index_state % summary.number_of_kpoints;
363 std::string spin_label = (summary.number_of_spin_components == 2)
364 ? ((spin_index == 0) ?
" (up)" :
" (dn)")
366 std::string line =
" E_k = ( ";
367 for (
int band_index = 0; band_index < summary.number_of_bands; ++band_index) {
369 std::snprintf(buffer,
372 summary.eigenvalues[kpoint_index_state][band_index] *
375 if (band_index < summary.number_of_bands - 1) {
380 const KPoint& kpoint = summary.kpoints[kpoint_index];
381 log::info(
" k_{} = ({:.4f}, {:.4f}, {:.4f}){}",
383 kpoint.coordinates.x,
384 kpoint.coordinates.y,
385 kpoint.coordinates.z,
388 if (kpoint_index_state + 1 < number_of_states_to_print) {
394 static void report_final_energies(
const PlanewaveKohnShamEnergies& energies) {
396 log::info(
" total energy = {:14.9f} Ry", energies.total());
397 log::info(
" band energy = {:14.9f}", energies.band_energy);
398 log::info(
" Hartree energy = {:14.9f}", energies.hartree_energy);
399 log::info(
" XC energy = {:14.9f}", energies.exchange_correlation_energy);
400 if (energies.ewald_energy != 0.0) {
401 log::info(
" Ewald energy = {:14.9f}", energies.ewald_energy);
403 if (energies.dispersion_energy() != 0.0) {
404 log::info(
" Dispersion (D3-BJ) = {:14.9f}", energies.dispersion_energy());
406 if (energies.hubbard_energy_contribution() != 0.0) {
408 energies.hubbard_energy_contribution());
415 if (energies.one_center_energy_contribution() != 0.0) {
416 log::info(
" one-center paw contrib. = {:14.9f}",
417 energies.one_center_energy_contribution());
419 if (std::abs(energies.smearing_entropy_contribution) >
421 log::info(
" smearing contribution = {:14.9f}",
422 energies.smearing_entropy_contribution);
423 log::info(
" E_one_electron + E_TS = {:14.9f}",
424 energies.band_energy + energies.double_counting_correction);
static void report_convergence_summary(const PlanewaveKohnShamSCFConvergenceSummary &summary)
static void report_first_iteration(Real total_energy, const PlanewaveKohnShamEnergies &energies)
static void report_memory_estimate(const PlanewaveMemoryEstimate &estimate)
static void report_setup_summary(const PlanewaveKohnShamSCFSetupSummary &summary)
void section(const std::string &title)
void debug(spdlog::format_string_t< Args... > fmt, Args &&... args)
void info(spdlog::format_string_t< Args... > fmt, Args &&... args)
constexpr double zero_vector_magnitude_threshold
constexpr const char * linear_algebra_libraries
The BLAS/LAPACK libraries this build links, as CMake found them; empty if unknown.
Real double_counting_correction
Real exchange_correlation_energy
int number_of_kpoints
The reporting rank's pool share under MPI, not the irreducible total.
std::vector< std::vector< Real > > eigenvalues
eigenvalues[kpoint_state_index][band_index] in Rydberg.
const PlanewaveKohnShamEnergies * energies
Real total_magnetization
Globally integrated spin-density difference in Bohr magnetons per cell.
Real absolute_magnetization
Globally integrated absolute spin-density difference in Bohr magnetons per cell.
int number_of_spin_components
int number_of_kpoint_pools
Set from the execution policy so the report can say whose k-points it lists.
std::vector< KPoint > kpoints
k-points in the same order as eigenvalues rows.
int fft_rho_grid_dimension_2
std::string diagonalizer_name
int davidson_basis_expansion_factor
Davidson working basis as a multiple of the band count; 0 when not iterative.
bool bands_are_distributed
True when those ranks divide the bands rather than the reciprocal-space coefficients.
int fft_rho_grid_dimension_3
int max_plane_waves_per_kpoint
int fft_rho_grid_dimension_1
int number_of_spin_components
int band_group_size
Ranks sharing a k-point pool, however that pool divides its work.
Real charge_density_energy_cutoff
bool density_symmetrization_active
int fft_wave_grid_dimension_3
int number_of_kpoint_pools
int number_of_symmetry_operations
int fft_wave_grid_dimension_2
std::string xc_functional_name
int fft_wave_grid_dimension_1
Real wavefunction_energy_cutoff
bool replicated_plane_wave_fallback_active
std::vector< PlanewaveMemoryEstimateTerm > transient
std::vector< PlanewaveMemoryEstimateTerm > steady_state
std::uint64_t steady_state_bytes