Refactor: move EXX file-list broadcast out of source_cell (#7635)#7663
Merged
mohanchen merged 1 commit intoJul 21, 2026
Merged
Conversation
Critsium-xy
force-pushed
the
decouple/source_cell-bcast-exx-7635
branch
from
July 21, 2026 07:00
d99198f to
6b51394
Compare
…ng#7635) bcast_cell.cpp reached into GlobalC::exx_info (source_hamilt/module_xc) to broadcast the ABFS/JLE orbital-file lists, making the source_cell data-structure layer depend on a higher layer. The ABFS/JLE orbital files are an LCAO-only concept, so the broadcast is placed in the LCAO EXX manager: add bcast_exx_file_lists() in source_lcao/setup_exx.{h,cpp} and invoke it at the start of Exx_NAO::init(), before Exx_LRI copies info_ri. init() runs in ESolver_KS_LCAO::before_all_runners (reused by TDDFT/DM2rho/DoubleXC; LR reuses the moved Exx_LRI), on all ranks, after setup_cell has populated the lists on rank 0 and before every consumer (RI-EXX, opt-ABFs generate_matrix, RPA postSCF). This removes the exx_info.h include, the helper, and the three broadcast calls from bcast_cell.cpp. The per-ionic-step re-broadcast previously done via bcast_unitcell is dropped, which is behaviour-neutral: the file lists are static once read from STRU. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Critsium-xy
force-pushed
the
decouple/source_cell-bcast-exx-7635
branch
from
July 21, 2026 08:01
6b51394 to
2c79471
Compare
mohanchen
approved these changes
Jul 21, 2026
8 tasks
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.
Background
Fixes #7635.
source_cellis a data-structure layer that should not depend on a higher layer.bcast_cell.cppviolated this by reaching intoGlobalC::exx_info(owned bysource_hamilt/module_xc) to broadcast the ABFS/JLE orbital-file lists:Data lifecycle
These lists live in
GlobalC::exx_infoand flow:source_cell/read_atom_species.cppparsesABFS_ORBITAL/ABFS_JLES_ORBITALfrom STRU duringsetup_cell.bcast_cell.cpp— the coupling this PR removes.Exx_LRI(RI-EXX),Exx_Opt_Orb::generate_matrix(opt-ABFs),RPA_LRI::postSCF(RPA).Change
The ABFS/JLE orbital files are an LCAO-only concept, so the broadcast belongs with the LCAO EXX manager, not in
source_cellor the generic XC module:bcast_exx_file_lists()insource_lcao/setup_exx.{h,cpp}.Exx_NAO::init(), beforeExx_LRIcopiesinfo_ri.exx_info.hinclude, thebcast_string_vectorhelper, and the three broadcast calls frombcast_cell.cpp.Exx_NAO::init()is called fromESolver_KS_LCAO::before_all_runners— reused by TDDFT / DM2rho / DoubleXC (they call the base), while LR reuses the already-builtExx_LRIviamove_exx_lri. It runs on all ranks, aftersetup_cellpopulated the lists on rank 0 (driver callssetup_cellbeforebefore_all_runners), and before every consumer:Exx_LRIcopy ofinfo_rihappens right after the broadcast insideinit().generate_matrixruns later in the samebefore_all_runners.RPA_LRI(GlobalC::exx_info.info_ri)is built inctrl_scf_lcaoduring the SCF run, afterbefore_all_runners.After this,
bcast_cell.cppno longer depends on any higher layer.Behaviour
Preserved. The broadcast still runs after the rank-0 populate and before any EXX consumption. The previous per-ionic-step re-broadcast (via
bcast_unitcellinupdate_cell.cppduring relax/MD) is dropped, which is behaviour-neutral because the file lists are static once read from STRU.Because
__EXXimplies__LCAO(LibRI requiresENABLE_LCAO),setup_exx.cppis always built whenever the broadcast is compiled.Verification
bcast_cell.cpphas no remainingexx/GlobalCreference; the only remainingexx_infouser insource_cellisread_atom_species.cpp(write side — see note).g++ -std=c++14 -fsyntax-onlypasses on the broadcast function body compiled against the realexx_infostructs (MPI headers stubbed locally).setup_exx.cppitself pulls LibRI/cereal and so is exercised by CI rather than locally.Note (out of scope)
The write side —
source_cell/read_atom_species.cppparsing the ABFS STRU sections intoGlobalC::exx_info— still couplessource_cellto the XC layer. #7635 is specifically about the broadcast inbcast_cell.cpp; moving the ABFS STRU-section parsing out ofsource_cellis larger and best handled as a follow-up.Global dependency budget (governance)
This PR is migration-neutral for the
GlobalV::/GlobalC::/PARAMbudget: the threeGlobalC::exx_infobroadcast calls are moved frombcast_cell.cpptosetup_exx.cpp(-3/+3, net zero in code), andsource_cellis fully decoupled from the XC layer. No new global-state coupling is introduced.