Skip to content

fix: refresh periodic ghost image shifts with skin - #8102

Merged
mohanchen merged 7 commits into
deepmodeling:developfrom
19hello:fix/md-skin-dynamic-image
Oct 10, 2026
Merged

mohanchen merged 7 commits into
deepmodeling:developfrom
19hello:fix/md-skin-dynamic-image

Conversation

@19hello

@19hello 19hello commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Reminder

  • I have read AGENTS.md and docs/developers_guide/agent_governance.md.
  • I have linked an issue or explained why this PR does not need one.
  • I have added adequate unit tests and/or case tests, or explained why not.
  • I have listed the exact verification commands run and their results.
  • I have described user-visible behavior changes, including INPUT parameter changes.
  • I have explained core-module impact for ESolver, HSolver, ElecState, Hamilt, Operator, Psi, or other source/ changes.
  • I have requested any needed governance exception below.

Linked Issue

No linked issue. This PR fixes a correctness issue discovered during local molecular-dynamics boundary-crossing validation.

Unit Tests and/or Case Tests for my changes

  • Commands run:
cmake -S /tmp/abacus-md-skin-dynamic \
      -B /tmp/abacus-md-skin-dynamic-build \
      -DBUILD_TESTING=ON \
      -DENABLE_MPI=ON \
      -DENABLE_LCAO=OFF \
      -DENABLE_LIBXC=OFF \
      -DCMAKE_BUILD_TYPE=Debug

cmake --build /tmp/abacus-md-skin-dynamic-build \
      --target MODULE_CELL_NEIGHBOR_mdcell_migrate_mpi \
      -j4

git diff --check

python3 tools/03_code_analysis/agent_governance_check.py --staged

- Result summary:
  - CMake configuration passed.
  - MODULE_CELL_NEIGHBOR_mdcell_migrate_mpi compiled and linked successfully.
  - git diff --check passed.
  - The staged governance check passed with a documentation-sync warning. The warning is addressed below because this change is internal and does not modify INPUT behavior.
  - Added MdCellMigrateMpiTest.SkinUpdatesPeriodicGhostImageWithoutRebuild, which verifies that a periodic ghost image is updated without rebuilding the neighbor-search object.
- Checks not run, with reason:
  - The 2-process MPI test was attempted, but the local runtime environment mixes toolchain and system BLAS/LAPACK/ScaLAPACK libraries. The executable exits before test startup with ABI errors involving gotoblas and sgetrs_N_parallel. This is a local runtime-library issue, not a test assertion failure.

### What's changed?

- Fixed periodic ghost coordinates during reusable-skin MD updates.
- Ghost image coordinates are now recalculated from the current atom position and ghost exchange slot instead of reusing a stale periodic image shift.
- The existing ghost layout and neighbor-search object are reused; crossing a periodic boundary does not force a complete ghost or neighbor-list rebuild.
- The ghost position message now carries both wrapped fractional coordinates and dynamically selected image coordinates.
- Added an MPI regression test covering an atom moving from frac.x = 0.99 to frac.x = 0.01 without neighbor-list rebuilding.
- No user-visible INPUT behavior changed.

### Governance Notes

- INPUT/docs changes: None required. This PR changes only internal MD ghost-coordinate communication and does not change any INPUT parameter, default value, parser behavior, or user-facing documentation.
- Core module impact: The changes are limited to MDCell neighbor decomposition and ghost-coordinate synchronization under source/source_cell/module_neighlist. There are no changes to ESolver, HSolver, ElecState, Hamilt, Operator, Psi, or electronic-structure algorithms.
- Exceptions requested: None.

@mohanchen mohanchen added Bugs Bugs that only solvable with sufficient knowledge of DFT Refactor Refactor ABACUS codes MD & LAM MD and Larege Atomic Models labels Oct 9, 2026
@mohanchen
mohanchen merged commit 0836dce into deepmodeling:develop Oct 10, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bugs Bugs that only solvable with sufficient knowledge of DFT 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