Refactor module_hamilt global dependencies - #7903
Open
Critsium-xy wants to merge 6 commits into
Open
Conversation
added 6 commits
September 3, 2026 17:49
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.
Reminder
AGENTS.mdanddocs/developers_guide/agent_governance.md.source/changes.Linked Issue
No linked issue. This is a focused architecture cleanup requested directly against
develop.Unit Tests and/or Case Tests for my changes
cmake --build build -j2./build/abacus_basic_omp --versionOMP_NUM_THREADS=1 ctest --test-dir build-module-hamilt-mpi --output-on-failure -R '^(MODULE_HAMILT_surchem_cal_(epsilon|pseudo|totn|vcav|vel)|MODULE_LCAO_hcontainer_(test|complex_test|cost_test|folding_test|transfer_test|para_test|output_test|add_value_test)|MODULE_LCAO_gint_(common|precision)_test|MODULE_HAMILT_ewald_rgen|MODULE_LCAO_(init_dm_from_file|output_hcontainer_consistency)_test)$'OMP_NUM_THREADS=1 bash /home/tiger/develop/abacus-develop/source/source_hamilt/module_hcontainer/test/parallel_hcontainer_tests.shfrombuild-module-hamilt-mpi/source/source_hamilt/module_hcontainer/testOMP_NUM_THREADS=1 ctest --test-dir build-module-hamilt-libxc --output-on-failure -R '^MODULE_HAMILT_XCTest_'OMP_NUM_THREADS=1 /home/tiger/develop/abacus-develop/build-module-hamilt-libxc/source/source_hamilt/module_vdw/test/MODULE_HAMILT_vdwTestfromsource/source_hamilt/module_vdw/testpython3 tools/03_code_analysis/agent_governance_check.py --base upstream/develop --head HEAD --format textgit diff --check upstream/develop...HEADrg -n --glob '*.{h,hpp,cpp,cc,cxx}' '\b(PARAM|GlobalC|GlobalV)\b' source/source_hamiltninja: no work to do.ABACUS version v3.11.0-beta8.MODULE_LCAO_hcontainer_para_testfailed only because CTest did not copyparallel_hcontainer_tests.shinto its working directory; invoking the same source script from the binary directory passed with 2, 3, and 4 MPI ranks.c6.txtandr0.txt.source/source_hamiltscan has zeroPARAM,GlobalC, orGlobalVreferences, including tests.pre-commit run abacus-agent-governance --all-fileswas unavailable becausepre-commitis not installed in this environment; the underlying repository governance script was run directly.What's changed?
SurchemParametersand inject solvent dielectric/cavity settings at the ESolver boundary; passnspinexplicitly into solvent-force calculation.nspin, gamma-only mode, magnetization mode, device selection, stream count) intoGintInfo; derivenlocalfromUnitCelland use the existingnbandsargument during wavefunction conversion.XC_Functionalprocess-level configuration and initialize it once fromInput_paraat the ESolver boundary; pass noncollinear magnetization flags explicitly during potential conversion.GlobalV/GlobalCdefinitions and parameter-header dependencies; link the formal global-variable implementation where remaining non-Hamiltonian test dependencies require it.GlobalVoccurrence insource/source_hamilt.There is no intended numerical or user-visible behavior change. INPUT names, defaults, parsing, and physical formulas are unchanged.
Governance Notes
source_hamiltno longer reaches intoPARAM,GlobalC, orGlobalV. Existing owners in ESolver/LCAO/PW now pass the required values at module boundaries. This intentionally moves a small number of reads outward while reducing the PR-wide global dependency count by 94.h_ewald_pw.hdeclares a publicstd::ofstream¶meter and therefore includes the standard stream declaration header; no project-layer dependency was added.