Remove GlobalC::exx_info - #7805
Open
mohanchen wants to merge 32 commits into
Open
Conversation
added 30 commits
August 10, 2026 16:36
Rename 7 files (32-29 chars → 12-22 chars):
- charge_mixing_preconditioner.cpp → mix_precond.cpp
- spherical_bessel_transformer.{cpp,h} → sph_bessel_tf.{cpp,h}
- read_input_item_postprocess.cpp → read_inp_postproc.cpp
- gint_vl_metagga_nspin4_gpu.{cpp,h} → gint_vl_mgga_n4_gpu.{cpp,h}
- snap_projector_half_tddft.{cpp,h} → snap_proj_half_tddft.{cpp,h}
Update all #include references, CMakeLists.txt, Makefile.Objects,
header guards, and code comments. Function names (e.g.
snap_projector_half_tddft) are preserved unchanged.
Rename 15 files (29-25 chars → 12-21 chars):
- read_input_item_elec_stru.cpp → read_inp_estruc.cpp
- gint_precision_controller.{cpp,h} → gint_prec_ctrl.{cpp,h}
- global_function-func_each_2.h → glob_fn_each2.h
- snap_phialpha_half_tddft.{cpp,h} → snap_pha_half_tddft.{cpp,h}
- snap_psibeta_half_tddft.{cpp,h} → snap_psb_half_tddft.{cpp,h}
- symmetry_rotation_output.cpp → symm_rot_out.cpp
- read_input_item_exx_dftu.cpp → read_inp_exx_dftu.cpp
- write_mlkedf_descriptors.{cpp,h} → write_mlkedf_desc.{cpp,h}
- global_function_ddotreal.cpp → glob_fn_ddotreal.cpp
- exx_abfs-construct_orbs.{cpp,h} → exx_abfs_ctor_orbs.{cpp,h}
Update all #include references, CMakeLists.txt, Makefile.Objects,
and header guards. Function and variable names preserved unchanged.
Rename 8 files (27-25 chars → 12-21 chars):
- to_wannier90_lcao_in_pw.{cpp,h} → to_w90_lcao_pw.{cpp,h}
- dist_matrix_transformer.{cpp,h} → dist_mat_tf.{cpp,h}
- element_basis_index-ORB.{cpp,h} → elem_basis_idx_orb.{cpp,h}
- sph_bessel_recursive-d1.cpp → sph_bessel_rec_d1.cpp
- sph_bessel_recursive-d2.cpp → sph_bessel_rec_d2.cpp
Update all #include references, CMakeLists.txt, Makefile.Objects,
and header guards. Function and class names preserved unchanged.
Rename 20 files (26 chars → 12-20 chars), including 6 .cpp/.h pairs:
- lattice_change_methods.{cpp,h} → lat_change_method.{cpp,h}
- vec_mul_vec_complex_op.{cpp,h} → vec_mul_cx_op.{cpp,h}
- psi_init_atomic_random.{cpp,h} → psi_init_atom_rand.{cpp,h}
- cal_mlkedf_descriptors.{cpp,h} → cal_mlkedf_desc.{cpp,h}
- gint_vl_metagga_nspin4.{cpp,h} → gint_vl_mgga_n4.{cpp,h}
- symmetry_rotation_spin.{cpp,h} → symm_rot_spin.{cpp,h}
- irreducible_sector_bvk.cpp → irred_sec_bvk.cpp
- read_input_item_{system,output,deepks}.cpp → read_inp_{sys,out,deepks}.cpp
- charge_mixing_residual.cpp → mix_resid.cpp
- elecstate_energy_terms.cpp → estate_e_terms.cpp
- pw_distributeg_method{1,2}.cpp → pw_distg_method{1,2}.cpp
Update all #include references, CMakeLists.txt, Makefile.Objects,
Makefile, header guards, and WARNING string literals. Function,
class, and struct names preserved unchanged.
Rename 20 files (26 chars → 12-20 chars), including 6 .cpp/.h pairs:
- lattice_change_methods.{cpp,h} → lat_change_method.{cpp,h}
- vec_mul_vec_complex_op.{cpp,h} → vec_mul_cx_op.{cpp,h}
- psi_init_atomic_random.{cpp,h} → psi_init_atom_rand.{cpp,h}
- cal_mlkedf_descriptors.{cpp,h} → cal_mlkedf_desc.{cpp,h}
- gint_vl_metagga_nspin4.{cpp,h} → gint_vl_mgga_n4.{cpp,h}
- symmetry_rotation_spin.{cpp,h} → symm_rot_spin.{cpp,h}
- irreducible_sector_bvk.cpp → irred_sec_bvk.cpp
- read_input_item_{system,output,deepks}.cpp → read_inp_{sys,out,deepks}.cpp
- charge_mixing_residual.cpp → mix_resid.cpp
- elecstate_energy_terms.cpp → estate_e_terms.cpp
- pw_distributeg_method{1,2}.cpp → pw_distg_method{1,2}.cpp
Update all #include references, CMakeLists.txt, Makefile.Objects,
Makefile, header guards, and WARNING string literals. Function,
class, and struct names preserved unchanged.
Rename 11 files (25 chars → 14-20 chars), including 3 .cpp/.h pairs:
- LCAO_deepks_interface.{cpp,h} → lcao_deepks_iface.{cpp,h}
- para_linear_transform.{cpp,h} → para_lin_tf.{cpp,h}
- read_input_item_{tddft,relax,other,ofdft,model}.cpp → read_inp_{...}.cpp
- vdwd3_autoset_xcparam.cpp → vdwd3_auto_xcpar.cpp
- element_covalent_radius.h → elem_cov_rad.h
Update all #include references, CMakeLists.txt, Makefile.Objects,
header guards, and python pyabacus references. Function, class, and
variable names preserved unchanged.
Note: esolver_ks_lcao_tddft, two_center_integrator, and blas_connector
files are intentionally kept unchanged per user request.
Rename 16 files from LCAO_* to lcao_* (remove uppercase letters):
- LCAO_allocate.cpp → lcao_allocate.cpp
- LCAO_domain.h → lcao_domain.h
- LCAO_HS_arrays.hpp → lcao_hs_arrays.hpp
- LCAO_init_basis.cpp → lcao_init_basis.cpp
- LCAO_nl_mu.cpp → lcao_nl_mu.cpp
- LCAO_nonlocal_info.h → lcao_nonlocal_info.h
- LCAO_set.{cpp,h} → lcao_set.{cpp,h}
- LCAO_set_{fs,mat2d,st,zero}.cpp → lcao_set_{...}.cpp
- LCAO_deepks.{cpp,h} → lcao_deepks.{cpp,h}
- LCAO_deepks_io.{cpp,h} → lcao_deepks_io.{cpp,h}
Update all #include references, CMakeLists.txt, Makefile.Objects,
and code comments. Namespace names (LCAO_domain::), class names,
and header guards preserved unchanged.
Rename 18 files from ORB_* to orb_* (remove uppercase letters):
- ORB_atomic.{cpp,h} → orb_atomic.{cpp,h}
- ORB_atomic_lm.{cpp,h} → orb_atomic_lm.{cpp,h}
- ORB_gaunt_table.{cpp,h} → orb_gaunt_table.{cpp,h}
- ORB_nonlocal.{cpp,h} → orb_nonlocal.{cpp,h}
- ORB_nonlocal_lm.{cpp,h} → orb_nonlocal_lm.{cpp,h}
- ORB_read.{cpp,h} → orb_read.{cpp,h}
- ORB_{atomic_lm,nonlocal_lm,nonlocal,read}_test.cpp → orb_{...}_test.cpp
- ORB_unittest.{cpp,h} → orb_unittest.{cpp,h}
Update all #include references, CMakeLists.txt, Makefile.Objects,
and README. Class names, header guards, and CMake target identifiers
preserved unchanged.
Rename 18 files from ORB_* to orb_* (remove uppercase letters):
- ORB_atomic.{cpp,h} → orb_atomic.{cpp,h}
- ORB_atomic_lm.{cpp,h} → orb_atomic_lm.{cpp,h}
- ORB_gaunt_table.{cpp,h} → orb_gaunt_table.{cpp,h}
- ORB_nonlocal.{cpp,h} → orb_nonlocal.{cpp,h}
- ORB_nonlocal_lm.{cpp,h} → orb_nonlocal_lm.{cpp,h}
- ORB_read.{cpp,h} → orb_read.{cpp,h}
- ORB_{atomic_lm,nonlocal_lm,nonlocal,read}_test.cpp → orb_{...}_test.cpp
- ORB_unittest.{cpp,h} → orb_unittest.{cpp,h}
Update all #include references, CMakeLists.txt, Makefile.Objects,
and README. Class names, header guards, and CMake target identifiers
preserved unchanged.
Rename 21 files, add module suffixes for force files, and
update header guards:
Correction abbreviation:
- H_correction_pw.cpp → h_corr_pw.cpp
Hamiltonian uppercase prefixes (H_* → h_*):
- H_Ewald_pw.{cpp,h} → h_ewald_pw.{cpp,h}
- H_Hartree_pw.{cpp,h} → h_hartree_pw.{cpp,h}
- H_TDDFT_pw.{cpp,h} → h_tddft_pw.{cpp,h}
LCAO force files (FORCE_* → force_lcao_*, FORCE_STRESS → force_stress_lcao):
- FORCE.h → force_lcao.h
- FORCE_gamma.cpp → force_lcao_gamma.cpp
- FORCE_k.cpp → force_lcao_k.cpp
- FORCE_STRESS.{cpp,h} → force_stress_lcao.{cpp,h}
PW force files (forces_* → force_pw_*, distinguish from LCAO):
- forces.{cpp,h} → force_pw.{cpp,h}
- forces_nl.cpp → force_pw_nl.cpp
- forces_onsite.cpp → force_pw_onsite.cpp
- forces_scc.cpp → force_pw_scc.cpp
- forces_us.cpp → force_pw_us.cpp
- forces_cc.cpp → force_pw_cc.cpp
Test files:
- opt_CG_test.cpp → opt_cg_test.cpp
- opt_TN_test.cpp → opt_tn_test.cpp
Header guards updated: HHARTREEPW_H → H_HARTREE_PW_H,
FORCES_H → FORCE_PW_H. Update all #include references,
CMakeLists.txt, and Makefile.Objects. Class/variable names preserved.
Rename 24 files to lowercase in source_lcao/module_ri/:
- Matrix_Orbs{11,21,22}.{cpp,h,hpp} → matrix_orbs{11,21,22}.{cpp,h,hpp}
- Mix_DMk_2D.{cpp,h} → mix_dmk_2d.{cpp,h}
- RI_2D_Comm.{cpp,h,hpp} → ri_2d_comm.{cpp,h,hpp}
- RI_Util.{h,hpp} → ri_util.{h,hpp}
- RPA_LRI.{h,hpp} → rpa_lri.{h,hpp}
- LRI_CV.{h,hpp} → lri_cv.{h,hpp}
- LRI_CV_Tools.{h,hpp} → lri_cv_tools.{h,hpp}
- make_gaunt_table-unittest.h → make_gaunt_table_unittest.h
Update all #include references, CMakeLists.txt, and Makefile.Objects.
Class names, namespace names, and header guards preserved unchanged.
Rename 22 files, replacing '-' with '_' and normalizing case:
- ABFs_Construct-PCA.{cpp,h} → abfs_construct_pca.{cpp,h}
- abfs-vector3_order.{h} → abfs_vector3_order.{h}
- abfs-vector3_order_test.cpp → abfs_vector3_order_test.cpp
- center2_orb-orb{11,21,22}.{cpp,h} → center2_orb_orb{11,21,22}.{cpp,h}
- exx_abfs-io.{cpp,h} → exx_abfs_io.{cpp,h}
- exx_abfs-jle.{cpp,h} → exx_abfs_jle.{cpp,h}
- exx_opt_orb-print.cpp → exx_opt_orb_print.cpp
- exx_abfs-construct_orbs-test.h → exx_abfs_construct_orbs_test.h
- gram_schmidt_orth-inl.h → gram_schmidt_orth_inl.h
- matrix-inl.h → matrix_inl.h
- scalapack-test.cpp → scalapack_test.cpp
- element_basis_index-{test.h,unittest.cpp} → element_basis_index_{test.h,unittest.cpp}
- Inverse_Matrix-test.h → invmat_ri_test.h
Update all #include references, CMakeLists.txt, Makefile.Objects,
and code comments. Class names and header guards preserved unchanged.
Rename 44 files, converting uppercase letters to lowercase:
- Cblacs.h → cblacs.h
- cal_pLpR.{cpp,h} → cal_plpr.{cpp,h}
- cal_r_overlap_R.{cpp,h} → cal_r_overlap_r.{cpp,h}
- ewald_Vq.{h,hpp} → ewald_vq.{h,hpp}
- ExxLriDetail.{cpp,h} → exx_lri_detail.{cpp,h}
- Exx_LRI.{h,hpp} → exx_lri.{h,hpp}
- Exx_LRI_interface.{h,hpp} → exx_lri_interface.{h,hpp}
- fR_overlap.{cpp,h} → fr_overlap.{cpp,h}
- Inverse_Matrix.{h,hpp} → invmat_ri.{h,hpp}
- opt_TN.hpp → opt_tn.hpp
- single_R_io.{cpp,h} → single_r_io.{cpp,h}
- symmetry_rotation_R{,_hcontainer}.hpp → symmetry_rotation_r{,_hcontainer}.hpp
- write_dH{,_terms}.{cpp,h} → write_dh{,_terms}.{cpp,h}
- write_HS{,_R,_sparse}.{cpp,h} → write_hs{,_r,_sparse}.{cpp,h}
- write_H_terms.{cpp,h} → write_h_terms.{cpp,h}
- pw_basis_{C2C,C2R}.cpp → pw_basis_{c2c,c2r}.cpp
- pw_basis_k_C2C.cpp → pw_basis_k_c2c.cpp
- test_T_NL_cd.cpp → test_t_nl_cd.cpp
- test-{big,other}.cpp → test_{big,other}.cpp
- test_hcontainer_readCSR.cpp → test_hcontainer_read_csr.cpp
- test_{cal_dm_R,dm_R_init}.cpp → test_{cal_dm_r,dm_r_init}.cpp
Update all #include references, CMakeLists.txt, Makefile.Objects,
CMake target names, and code comments. Class names, function names,
namespace names, and header guards preserved unchanged.
Rename 6 test files to match their already-renamed source files: - spherical_bessel_transformer_test → sph_bessel_tf_test - gint_precision_controller_test → gint_prec_ctrl_test - snap_psibeta_half_tddft_test → snap_psb_half_tddft_test - lattice_change_methods_test → lat_change_method_test - symmetry_rotation_spin_test → symm_rot_spin_test - symmetry_rho_soc_test → symm_rho_soc_test Update CMakeLists.txt entries and log file references accordingly.
Apply KISS abbreviation rules to 15 test files: - construct→ctor, radial→rad, interpolation→interp - integrator→integ, initializer→init, recursive→rec - clebsch_gordan→cg (math standard), element→elem, index→idx - vector3→vec3, algorithms→algo, helper→hlp - system→sys, variable→var, chebyshev→cheby - operator→op Update CMakeLists.txt entries, #include paths, and header guards accordingly.
Rename 42 numbered test files in source_basis/module_pw/test/: - test1-1-1.cpp → test1_1_1.cpp - test1-2.cpp → test1_2.cpp - ... (all test*-*.cpp files) Update CMakeLists.txt references accordingly. Follows project naming convention: filenames must use underscores, not dashes.
- source_base: lowercase opt_CG/opt_DCsrch → opt_cg/opt_dcsrch (4 files)
- symmetry modules: unify symmetry_ → symm_ prefix (16 renamed,
61 total files updated across source_cell/symmetry, source_estate,
source_lcao/module_ri/module_exx_symmetry, and all call sites;
module entry points symmetry.h / symmetry.cpp unchanged, class
names Symmetry_Basic / Symmetry_rho / Symmetry_rotation preserved)
- source_cell: unify read_pseudo → read_pp_ucell to match read_pp
series (2 renamed, 18 total files updated across CMake targets,
Makefile.Objects, and callers; function names untouched)
- test files: unify _unittest suffix → _test (4 files: orb_test,
element_basis_index_test, make_gaunt_table_test; include paths
and header guards synced)
- source_lcao: disambiguate duplicate dftu_lcao name — rename
dftu_lcao.{cpp,h} → setup_dftu_lcao.{cpp,h} (init/finish helpers);
module_operator_lcao/dftu_lcao (DFTU operator implementation)
retains original name
Sync with latest upstream develop to resolve conflicts with PR deepmodeling#7797. All conflicts auto-resolved.
Resolve conflicts: - Keep HEAD file renaming (psi_init_atom_rand instead of psi_init_atomic_random) - Use correct include paths (sph_bessel_tf.h and psi_base.h) - Keep psi_init_unit_test.cpp as the test file name - Resolve rename/rename conflict by keeping HEAD's psi_init_unit_test.cpp
- Update initialize() signature to match psi_init_atomic's new interface - Use this->npol_ instead of PARAM.globalv.npol - Remove unnecessary includes (vnl_pw.h, parameter.h)
The init_psig() method accesses pw_wfc_->npwk_max which requires the complete type of ModulePW::PW_Basis_K, not just the forward declaration.
Resolve conflicts caused by both branches moving files from source_io to source_base/source_cell and renaming filenames to lowercase. Resolution strategy: - Keep our lowercase filename renames (write_hs.h, write_hs_r.h, etc.) - Use upstream's correct include paths for moved files (source_base/module_out/, source_cell/) - Remove duplicate entries in Makefile.Objects for files already moved to OBJS_BASE/OBJS_CELL - Remove unnecessary explicit source compilation of orb_io.cpp and sparse_matrix.cpp in tests (now provided by base library)
…nter Add Exx_Info* exx_info_ member to ESolver_KS base class, initialized to &GlobalC::exx_info in the constructor. Replace all direct GlobalC::exx_info accesses in ESolver subclasses (LCAO, LCAOPW, PW, LCAO_TDDFT) with exx_info_-> member access. This is the first step toward removing the GlobalC::exx_info global. The global still exists; this commit only introduces the indirection layer so subsequent commits can redirect the pointer to an owned Exx_Info instance.
Replace GlobalC::exx_info accesses in the LCAO module with explicit parameter passing: - setup_exx: add Exx_Info& param to init/before_runner/before_scf - HamiltLCAO: add const Exx_Info& param to constructor, forward to OperatorEXX - OperatorEXX: add const Exx_Info*/const Exx_Info& params to both constructors, store as exx_info_ptr member - Force_Stress_LCAO::getForceStress: add const Exx_Info& param - LCAO_domain::set_pot: add Exx_Info& param, forward to exx_nao - RDMFT: add const Exx_Info& param to init, store as exx_info_ member - Update all call sites in esolver_ks_lcao, esolver_ks_lcao_tddft, esolver_double_xc, lcao_others, write_vxc to pass exx_info The source_io module (write_vxc.hpp) still uses GlobalC::exx_info directly and will be addressed in a subsequent commit.
Replace GlobalC::exx_info accesses in the PW module with explicit parameter passing: - HamiltPW: add const Exx_Info* param to constructor, use it for EXX operator initialization - Exx_HelperBase/Exx_Helper: add const Exx_Info& param to init() and before_scf() virtual methods - Stress_PW::cal_stress: add const Exx_Info& param for EXX stress - HSolverLIP::solve: add const Exx_Info& param for LCAO-in-PW EXX - Update all call sites in esolver_ks_pw, esolver_ks_lcaopw - Update HamiltLIP and HamiltSdftPW derived constructors to pass nullptr to HamiltPW base - Update all test mock implementations and call sites The source_io module still uses GlobalC::exx_info directly and will be addressed in a subsequent commit.
Change ESolver_KS from holding a pointer to GlobalC::exx_info to owning its own Exx_Info value member (exx_info_obj_). The constructor copies the content from GlobalC::exx_info (initialized by Input_Conv::Convert) into the owned object, so ESolver internals now operate on their own copy. The exx_info_ pointer still points to exx_info_obj_ for uniform access, preserving the parameter-passing pattern established in the previous commits. This breaks the runtime dependency on GlobalC::exx_info from ESolver internals and prepares for removing the global entirely in the next commit. GlobalC::exx_info is kept for now as other modules still reference it during the transition.
added 2 commits
August 12, 2026 13:38
Remove the GlobalC::exx_info global instance entirely. The Exx_Info data is now owned by ESolver_KS (exx_info_obj_ member) and passed through function parameters to all consumers. Key changes: - Extract Exx_Info initialization logic from Input_Conv::Convert() into a standalone init_exx_info(Exx_Info&, const Input_para&) function in exx_info.cpp. ESolver_KS constructor calls this to initialize its owned Exx_Info object directly from input parameters. - Remove GlobalC::exx_info extern declaration and definition. - Add const Exx_Info& parameter to all functions that previously accessed GlobalC::exx_info: ctrl_runner_lcao, ctrl_scf_lcao, ctrl_iter_lcao, ctrl_output_td, write_dH_components, write_dH_sum, write_dH_exx, write_h_exx, write_Vxc, write_eband_terms, sum_HR, write_current, and their helper functions. - Update all call sites in ESolver to pass *exx_info_ (the owned Exx_Info object). - ESolver_LR (LR-TDDFT) now owns its Exx_Info as a value member initialized via init_exx_info instead of referencing the global. - Update stale include comments referencing GlobalC::exx_info.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove GlobalC::exx_info