Skip to content

Remove GlobalC::exx_info in module_ri#7631

Open
mohanchen wants to merge 11 commits into
deepmodeling:developfrom
mohanchen:20260713
Open

Remove GlobalC::exx_info in module_ri#7631
mohanchen wants to merge 11 commits into
deepmodeling:developfrom
mohanchen:20260713

Conversation

@mohanchen

Copy link
Copy Markdown
Collaborator

Remove GlobalC::exx_info in module_ri

abacus_fixer added 10 commits July 13, 2026 22:11
…exx_info removal

Change Exx_LRI and RPA_LRI's info_ri from const reference to value copy to eliminate lifetime dependencies on GlobalC::exx_info. Add abfs_Lmax_ member to Exx_LRI, hybrid_step_ member to Exx_LRI_interface, and p_info_ri pointer to LRI_CV for subsequent phases. All changes are backward-compatible.
Change abfs_Lmax writing in Exx_LRI::init() and init_spencer() to write to member variable abfs_Lmax_ first, then sync to GlobalC::exx_info (dual-write) for backward compatibility.
Call cv.set_info_ri(&this->info) after cv.set_orbitals() in both Exx_LRI::init() and init_spencer(). Change LRI_CV::Cs_inv_thr reads to dual-read (pointer first, global fallback). Fix exx_rotate_abfs to read rotate_abfs from member reference instead of GlobalC.
Change 5 shrink_abfs_pca_thr reads in RPA_LRI and 2 exx_symmetry_realspace reads in Exx_LRI_interface from GlobalC::exx_info.info_ri to this->info or this->exx_ptr->info.
Add abfs_Lmax parameter to Ewald_Vq::init(), store as member, and use in init_ions(). Pass abfs_Lmax_ from Exx_LRI to Ewald_Vq. Update RPA_LRI to read from exx_cut_coulomb->abfs_Lmax(). Remove dual-write to GlobalC for abfs_Lmax.
Replace 3 places in RPA_LRI that tamper with GlobalC::exx_info.info_ri.ccp_rmesh_times: use local Exx_Info_RI copy instead. This eliminates the dangerous 'save-modify-use-restore' pattern.
Add Exx_Info_Global as constructor parameter and store as member. Replace all 18 GlobalC::exx_info.info_global reads with this->info_global. Change hybrid_step write from global to member variable.
Remove 3 lines that write ccp_type/hybrid_alpha to GlobalC and call sync_from_global(). This->info already has correct coulomb_param from construction. Also replace shrink_LU_inv_thr read with this->info.
…ludes

Delete global static object exx_lri_rpa in RPA_LRI.h. Update exx_rotate_abfs.h comment. Clean up includes in LRI_CV.hpp, exx_lip.hpp, and Exx_LRI_interface.hpp. Remove GlobalC::exx_info fallback in LRI_CV. After this phase, GlobalC::exx_info is no longer used in module_ri.
@mohanchen mohanchen added EXX and lr-TDDFT Related to EXX or lr-TDDFT Refactor Refactor ABACUS codes The Absolute Zero Reduce the "entropy" of the code to 0 labels Jul 14, 2026
@mohanchen mohanchen requested a review from Critsium-xy July 14, 2026 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

EXX and lr-TDDFT Related to EXX or lr-TDDFT 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