Repository navigation
refactor(ao): remove Parallel_Orbitals implicit upcast - #8290
Merged
mohanchen merged 41 commits intoNov 5, 2026
Merged
Conversation
Purely additive: no call site changes, inheritance still in place. para_2d() (const + non-const) returns *this while Parallel_Orbitals derives from Parallel_2D, giving the two escape hatches a const getter cannot serve (LR_Util::setup_2d_division mutation, test-side descriptor writes). get_blacs_ctxt() completes the inherited getter family, which covers the other seven public data members.
…rate module_rt call sites
…igrate module_dftu call sites
…rate module_dm call sites
…ate pyabacus call sites
…rate module_lr call sites
…rate misc_prod call sites
…bitals, migrate module_operator_lcao call sites
…rate test_side call sites
…, migrate module_current call sites
…rate module_ao call sites
…it para_2d() access
…is_serial() accessor
…s (zero production delta vs D4)
…r only, zero production delta)
… (getter-equiv, derived-layer sync, value-semantics static_assert, MPI+serial dual coverage)
…d-inheritance # Conflicts: # source/source_esolver/esolver_ks_lcao_tddft.cpp # source/source_hamilt/module_gint/gint_dvlocal.cpp
…tion-guard # Conflicts: # source/source_basis/module_ao/test/CMakeLists.txt # source/source_basis/module_ao/test/parallel_orbitals_test.cpp # source/source_io/module_hs/unittests/CMakeLists.txt # source/source_io/test/CMakeLists.txt # source/source_lcao/module_dftu/unittests/CMakeLists.txt # source/source_lcao/module_rt/test/CMakeLists.txt
Resolve the single conflict in output_mulliken.cpp by keeping the upstream extraction of collect_MW_nspin4 (deepmodeling#8250, which also corrects the noncollinear M_y sign) instead of the pre-extraction inline loop carried on this branch, then migrate the helper's accessor calls to the explicit para_2d() distribution now that Parallel_Orbitals no longer inherits Parallel_2D.
…cessor The noncollinear Mulliken test added by deepmodeling#8250 sets up a serial layout on a Parallel_Orbitals and sizes its ComplexMatrix from the distribution's row and column counts. `set_serial`, `nrow` and `ncol` belong to Parallel_2D, which Parallel_Orbitals no longer inherits, so route both uses through para_2d(). Without this the test target does not compile on top of current develop.
Replace the PR#TBD placeholders with the actual condition for deleting para_2d() and the implicit `operator const Parallel_2D&`, and record that the eventual accessor name carries no get_ prefix, which is the convention this repository follows. Comment text only.
…s test Repository rule 11 requires one test TU per exercised source file: the new test_parallel_orbitals_composition.cpp did not match any source file, while parallel_orbitals_test.cpp already exercises ../parallel_orbitals.cpp. Move its four guard cases, the two fixture helpers, and the compile-time static_asserts into the existing file, and delete the extra source, its MODULE_AO_parallel_orbitals_composition_test target plus _para MPI registration, and its runner script. No assertion was changed, weakened, or dropped: every static_assert and every EXPECT_/ASSERT_ line from the deleted file appears verbatim in the merged file (verified with a line-by-line set difference). The merged binary still runs 5 gtest cases (TestParaO.Divide2D + the 4 composition cases) and passes both the serial and the mpirun 2/3/4-rank ctest registrations.
…allel2d-inheritance
Route optional LCAO backends through the explicit Parallel_Orbitals distribution. This covers CUDA, DeePKS, LibRI/EXX, BSE, RDMFT, RPA, cuBLASMp, and the PEXSI test fixture without changing the composition seam.
…tion-guard # Conflicts: # source/source_basis/module_ao/parallel_orbitals.h # source/source_hsolver/unittests/test_diago_pexsi.cpp
…n-guard # Conflicts: # source/source_basis/module_ao/parallel_orbitals.h # source/source_basis/module_ao/test/parallel_orbitals_test.cpp # source/source_hamilt/module_hcontainer/test/test_hcontainer.cpp # source/source_hamilt/module_hcontainer/test/test_hcontainer_complex.cpp # source/source_hamilt/module_hcontainer/test/test_hcontainer_output.cpp # source/source_hsolver/unittests/test_diago_pexsi.cpp # source/source_io/module_ctrl/ctrl_scf_lcao.cpp # source/source_io/module_dm/test/test_write_dmr.cpp # source/source_io/module_hs/unittests/csr_test_helpers.h # source/source_io/module_hs/unittests/test_hsr_writer.cpp # source/source_io/unittests/test_write_wfc_nao.cpp # source/source_lcao/module_bse/bse_util.cpp # source/source_lcao/module_deltaspin/test/spin_constrain_test.cpp
AsTonyshment
approved these changes
Nov 4, 2026
ABACUS-PR-BOT
left a comment
Collaborator
There was a problem hiding this comment.
One non-blocking suggestion for the new move test. Static review only; no builds or tests were run.
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.
Summary
Parallel_Orbitalstoconst Parallel_2D&.para_2d()access.set_serial,set, and read-only getters instead.Behavior
No INPUT, output-format, numerical, or public workflow behavior changes. Documentation is not required because this is an internal ownership/interface cleanup.
Verification
Run with
abacus-dev/1.0, GNU 11.4.0, andOMP_NUM_THREADS=1:cmake --build build -j 8 ctest --test-dir build -R "^MODULE_AO_parallel_orbitals|^MODULE_LCAO_hcontainer|^MODULE_IO_hs_dense_io|^MODULE_IO_hsr_writer|^MODULE_IO_write_dmr|^MODULE_LCAO_deltaspin_spin_constrain|^MODULE_HSOLVER_LCAO" --output-on-failure python3 tools/03_code_analysis/agent_governance_check.py --base upstream/develop --head HEAD --format text git diff --check upstream/develop...HEAD[100%].100% tests passed, 0 tests failed out of 17.Auto-merge is intentionally disabled; merge remains a manual decision.