Skip to content

Refactor domain decomposition into focused source files - #8292

Merged
mohanchen merged 6 commits into
deepmodeling:developfrom
19hello:feature/domain-decomposition-split
Nov 6, 2026
Merged

mohanchen merged 6 commits into
deepmodeling:developfrom
19hello:feature/domain-decomposition-split

Conversation

@19hello

@19hello 19hello commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Reminder

  • I have read AGENTS.md and docs/developers_guide/agent_governance.md.
  • No linked issue: this is a requested source organization refactor.
  • Existing focused tests cover migration, ghost exchange, periodic images, force return, and neighbor refresh; no new behavior needs a new test.
  • Exact verification commands and results are listed below.
  • No user-visible behavior or INPUT parameter changes.
  • Core module impact is limited to source organization and build linkage.
  • No governance exception requested.

Linked Issue

None; requested refactor to keep each domain decomposition implementation file under 500 lines.

Unit Tests and/or Case Tests for my changes

  • cmake --build build_parallel_md1_current --target domain_decomposition MODULE_CELL_NEIGHBOR_mdcell_migrate_mpi -j8 — passed after each extraction.
  • cmake --build build_parallel_md1_current --target MODULE_CELL_NEIGHBOR_neighbor_search MODULE_CELL_NEIGHBOR_mdcell_reader MODULE_MD_LJ_pot -j8 — passed.
  • source toolchain/install/setup && export LD_LIBRARY_PATH=/tmp/abacus-domain-blas:$LD_LIBRARY_PATH && ctest --test-dir build_parallel_md1_current --output-on-failure -j2 -R 'MODULE_CELL_NEIGHBOR_(neighbor_search|mdcell_migrate_mpi|domain_decomposition_np1|domain_decomposition_np4|mdcell_reader_np4)|MODULE_MD_LJ_pot' — passed, 6/6. The temporary path maps both libblas.so.3 and liblapack.so.3 to the repository toolchain OpenBLAS library. The first run without this local workaround failed before test execution because the host BLAS/LAPACK libraries report undefined symbol: gotoblas.
  • python3 tools/03_code_analysis/agent_governance_check.py --base origin/develop --head HEAD --format text — exit 0; PR-body test-evidence and docs-note warnings addressed here.
  • python3 tools/03_code_analysis/code_quality_score.py source/source_cell/dom_core.cpp source/source_cell/dom_ghost.cpp source/source_cell/dom_migrate.cpp source/source_cell/dom_force.cpp source/source_cell/dom_decomp.h — 5/5 passing.
  • git diff --check origin/develop...HEAD — passed.

What's changed?

Split the original 1,059-line implementation into dom_core.cpp (386 lines), dom_ghost.cpp (402), dom_migrate.cpp (183), and dom_force.cpp (121). Renamed the header to dom_decomp.h. Every renamed file is at most 15 characters including its extension. Updated all include paths, the main CMake OBJECT library, all direct test source lists, and the legacy Makefile object list. Kept the DomainDecomposition class interface and algorithm behavior.

Governance Notes

  • INPUT/docs changes: none; behavior and public interfaces are unchanged, so no user documentation update is needed.
  • Core module impact: source_cell implementation, include paths, and build wiring only; direct MPI calls remain in the original transport implementation.
  • Review comment addressed: dom_migrate.cpp directly includes <cassert>, <cmath>, <limits>, and <utility>; dom_ghost.cpp directly includes <cassert>.
  • The governance header dependency warning for md_test_fixture.h is an include-path rename of the same header, not a new dependency.
  • pyabacus source lists were checked and do not list this implementation directly.
  • Exceptions requested: none.

Latest develop synchronization

  • Merged origin/develop at 3c1dddac06 into the PR branch; no conflict.
  • Rebuilt the five affected targets and reran the six selected CTests after the merge: all passed.
  • python3 tools/03_code_analysis/agent_governance_check.py --base origin/develop --head HEAD --format text — exit 0, with only the include-path rename and PR documentation-note warnings explained above.
  • git diff --check origin/develop...HEAD — passed.

@ABACUS-PR-BOT ABACUS-PR-BOT left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Static review at 0056698ef: no new correctness issue found in the source split. No builds or tests were run.

Comment thread source/source_cell/dom_migrate.cpp Resolved
@mohanchen mohanchen added Refactor Refactor ABACUS codes The Absolute Zero Reduce the "entropy" of the code to 0 labels Nov 6, 2026
@mohanchen
mohanchen merged commit d4ff2cc into deepmodeling:develop Nov 6, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

3 participants