Skip to content

Parallel MD - #7812

Open
19hello wants to merge 10 commits into
deepmodeling:developfrom
19hello:pr/mdcell-runtime
Open

Parallel MD#7812
19hello wants to merge 10 commits into
deepmodeling:developfrom
19hello:pr/mdcell-runtime

Conversation

@19hello

@19hello 19hello commented Aug 13, 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

N/A. This is PR3 of the parallel-MD series, following the merged distributed MDCell infrastructure from #7768.

Unit Tests and/or Case Tests for my changes

  • Commands run:
    • cmake --build /tmp/abacus-pr3-full -j4 --target abacus_basic_para MODULE_MD_LJ_pot MODULE_IO_input_test_para
    • env LD_PRELOAD=/usr/lib/x86_64-linux-gnu/openblas-openmp/libopenblas.so.0 ctest --test-dir /tmp/abacus-pr3-full -R '^(MODULE_IO_input_test_para|MODULE_MD_LJ_pot)$' --output-on-failure
    • env OMP_NUM_THREADS=1 LD_PRELOAD=/usr/lib/x86_64-linux-gnu/openblas-openmp/libopenblas.so.0 bash ../integrate/Autotest.sh -a /tmp/abacus-pr3- full/abacus_basic_para -n 4 -r '^(01_LJ_Anderson|04_LJ_Langevin)$'
    • python3 tools/03_code_analysis/agent_governance_check.py --staged
  • Result summary:
    • MODULE_IO_input_test_para and MODULE_MD_LJ_pot passed.
    • The two 4-rank random-MD cases passed all energy, force, and stress comparisons after updating their references.
    • A 4-rank native MDCell LJ run verified that md_out_force=0, md_dumpfreq=0, and md_restartfreq=0 suppress TOTAL-FORCE, MD_dump,
      STRU_MD_*, and Restart_md.txt without affecting MD execution.
    • Governance check reported no findings for the final reference update.
  • Checks not run, with reason:
    • The complete MD C++ unit-test set and full integration suite were not rerun after the final reference-only commit. The final commit changes only
      the two validated reference files.

What's changed?

  • Enable native distributed MDCell runtime workflows for MD-capable LJ, DP, and NEP solvers without constructing a global UnitCell for the native
    path.
  • Keep atom ownership, migration, neighbor construction, force evaluation, MD restart, and MD output distributed by MPI rank.
  • Use 64-bit atom counters in the distributed MDCell path.
  • Stream MDCell TOTAL-FORCE output to rank 0 without allocating a global force array.
  • Add md_out_force (default true) to control the MDCell TOTAL-FORCE table in running_md.log.
  • Allow md_dumpfreq=0 to disable MD_dump, and md_restartfreq=0 to disable STRU_MD_* and Restart_md.txt.
  • Initialize an independent MD random-number stream on each MPI rank. Anderson and Langevin 4-rank references are updated accordingly.

Governance Notes

  • INPUT/docs changes:
    • Added and documented md_out_force.
    • Documented zero-frequency behavior for md_dumpfreq and md_restartfreq.
    • Updated md_seed documentation to describe rank-local seeding.
  • Core module impact:
    • source_cell: adds and maintains distributed MDCell state, STRU reading, migration, and distributed output.
    • source_md: drives MD directly on MDCell; MD depends on IO only for existing parameter and output facilities.
    • source_esolver: LJ, DP, and NEP provide native MDCell force/stress/cutoff support.
    • No HSolver, ElecState, Hamilt, Operator, or Psi workflow changes.
  • Exceptions requested:
    • None. The remaining GlobalV::ofs_running use in the MD-to-IO force-output call follows the existing output API; the relocation reduces rather
      than increases the PR-level global dependency count.

@19hello
19hello requested a review from mohanchen August 13, 2026 12:14
@mohanchen mohanchen added Features Needed The features are indeed needed, and developers should have sophisticated knowledge Refactor Refactor ABACUS codes labels Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Features Needed The features are indeed needed, and developers should have sophisticated knowledge Refactor Refactor ABACUS codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants