Skip to content

refactor MDCell and domain decomposition interfaces - #7954

Open
19hello wants to merge 4 commits into
deepmodeling:developfrom
19hello:refarctor_mdcell
Open

refactor MDCell and domain decomposition interfaces#7954
19hello wants to merge 4 commits into
deepmodeling:developfrom
19hello:refarctor_mdcell

Conversation

@19hello

@19hello 19hello commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Reminder

  • I have read AGENTS.md and docs/developers_guide/agent_governance.md.
  • I have explained why this PR does not need a linked issue.
  • I have added and updated focused unit tests for the affected MD and neighbor-list interfaces.
  • I have listed the exact verification commands and their results.
  • I have described user-visible behavior changes, including that there are no INPUT parameter changes.
  • I have explained the core-module impact.
  • No governance exception is requested.

Linked Issue

This is a core MDCell and domain-decomposition interface refactor. No separate issue is required because the changes are being developed and
reviewed as a focused refactoring PR.

Unit Tests and/or Case Tests for my changes

  • Commands run:

    • cmake --build build_parallel_md1_current --target MODULE_MD_run MODULE_MD_func MODULE_CELL_NEIGHBOR_mdcell_migrate_mpi -j4
    • python3 tools/03_code_analysis/agent_governance_check.py --staged
    • git diff --check
    • Global search for remaining cell.nat(), mdcell.nat(), and ucell.nat() calls.
  • Result summary:

    • MODULE_MD_run passed.
    • MODULE_MD_func passed.
    • MODULE_CELL_NEIGHBOR_mdcell_migrate_mpi passed.
    • Agent governance check completed with no blocking findings.
    • git diff --check passed.
    • No remaining calls to the removed BaseCell::nat() interface were found.
  • Checks not run, with reason:

    • Full runtime and MPI case tests were not run in this environment. MPI runtime behavior may be affected by sandbox process and socket
      restrictions, and the available external runtime environment has unresolved BLAS symbol issues.

What's changed?

  • Refactored MDCell, BaseCell, and DomainDecomposition interfaces.
  • Removed obsolete Cell accessor wrappers and changed production call sites to use the corresponding public MDCell state or UnitCell state directly.
  • Changed BaseCell::kind() to a virtual interface implemented directly by MDCell and UnitCell.
  • Consolidated MDCell initialization around owned atoms and backing UnitCell assignment.
  • Reorganized MDCell and DomainDecomposition declarations and definitions by lifecycle, initialization, neighbor-list, geometry, communication,
    and helper responsibilities.
  • Simplified ghost atom migration, ghost coordinate updates, ghost force accumulation, and communication tag handling.
  • Preserved neighbor-list skin logic using neighbor_reference_frac_.
  • Updated affected ESolver, MD, output, driver, relax test, and unit-test call sites.
  • Restored and retained force clearing during MDCell initialization and ghost exchange.
  • No user-visible INPUT behavior has changed.

Governance Notes

  • INPUT/docs changes:

    • No INPUT parameters, defaults, parsing behavior, or user-facing documentation were changed.
  • Core module impact:

    • BaseCell and MDCell interface changes affect Cell consumers.
    • ESolver implementations were updated to use UnitCell::nat or MDCell::nat_ as appropriate.
    • MD integrators and neighbor-list code were updated to use the new MDCell state layout.
    • No intended behavioral changes were made to HSolver, ElecState, Hamilt, Operator, or Psi.
  • Exceptions requested:

    • None.
    • The governance check reported only non-blocking warnings for migration-neutral global dependency changes, required MDCell header dependencies,
      and PR documentation metadata.

@mohanchen mohanchen added MD & LAM MD and Larege Atomic Models Refactor Refactor ABACUS codes labels Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

MD & LAM MD and Larege Atomic Models Refactor Refactor ABACUS codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants