Skip to content

Conversation

@mohanchen
Copy link
Collaborator

Fixed uninitialized variables.

abacus_fixer and others added 15 commits January 23, 2026 20:25
1. Remove #ifdef __MPI from timer code, encapsulate in timer_wrapper.h
2. Move ESolver clean logic to after_all_runners method
3. Replace clean_esolver calls with direct delete p_esolver
4. Remove #ifdef __MPI from delete p_esolver
5. Add Cblacs_exit(1) in after_all_runners for LCAO calculations
This commit fixes 37 uninitialized variables (19 int, 18 double) in 19 files within the source_pw directory. All variables are initialized to 0 or 0.0 to prevent undefined behavior and improve code safety.

Affected files:
- source_stodft/sto_wf.cpp
- source_stodft/sto_tool.h
- source_stodft/sto_iter.h
- source_stodft/sto_iter.cpp
- source_stodft/sto_forces.cpp
- source_pwdft/stress_func_loc.cpp
- source_pwdft/soc.cpp
- source_pwdft/parallel_grid.cpp
- source_pwdft/onsite_projector.cpp
- source_pwdft/operator_pw/exx_pw_ace.cpp
- source_pwdft/onsite_proj_tools.h
- source_pwdft/nonlocal_maths.hpp
- source_pwdft/fs_nonlocal_tools.h
- source_pwdft/elecond.cpp
- source_pwdft/forces_cc.cpp
- source_pwdft/VNL_in_pw.cpp
- source_pwdft/forces_scc.cpp
- source_pwdft/forces.cpp
- source_pwdft/VNL_grad_pw.cpp
This commit fixes uninitialized variables (int and double) in 18 files within the source_lcao directory. All variables are initialized to 0 or 0.0 to prevent undefined behavior and improve code safety.

Affected files:
- spar_hsr.cpp, spar_dh.cpp
- wavefunc_in_pw.cpp
- module_rt/velocity_op.cpp, module_rt/norm_psi.cpp, module_rt/propagator.cpp, module_rt/td_folding.cpp, module_rt/boundary_fix.cpp
- module_ri/exx_abfs-io.cpp, module_ri/module_exx_symmetry/irreducible_sector_bvk.cpp, module_ri/module_exx_symmetry/symmetry_rotation.cpp
- module_lr/dm_trans/dmr_complex.cpp, module_lr/esolver_lrtd_lcao.cpp
- module_operator_lcao/dspin_force_stress.hpp, module_operator_lcao/dftu_force_stress.hpp
- module_hcontainer/func_folding.cpp, module_hcontainer/test/test_hcontainer.cpp
- module_gint/set_ddphi.cpp
@mohanchen mohanchen requested a review from Critsium-xy January 25, 2026 14:58
@mohanchen mohanchen added Refactor Refactor ABACUS codes The Absolute Zero Reduce the "entropy" of the code to 0 labels Jan 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Refactor Refactor ABACUS codes The Absolute Zero Reduce the "entropy" of the code to 0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant