Skip to content

Refactor MD setup for pre-parallel cleanup#7410

Closed
Audrey-777 wants to merge 5 commits into
deepmodeling:developfrom
Audrey-777:refactor/md-factory-code-only
Closed

Refactor MD setup for pre-parallel cleanup#7410
Audrey-777 wants to merge 5 commits into
deepmodeling:developfrom
Audrey-777:refactor/md-factory-code-only

Conversation

@Audrey-777
Copy link
Copy Markdown

Summary

This PR performs a scoped MD code refactor in preparation for future parallel optimization. It does not intend to change
functionality, numerical behavior, or performance.

Changes include:

  • Extract MD runner creation into a local factory helper with std::unique_ptr ownership.
  • Move DP/NEP model temporary buffers to solver members for clearer lifetime management.
  • Add MD kinetic/stress state helper structs and pure helper functions while preserving existing APIs as wrappers.
  • Introduce shared MD test fixtures and remove duplicated test source registration.

Validation

  • Built production target successfully:
    cmake -S . -B build-prod -DBUILD_TESTING=OFF -DENABLE_MPI=OFF -DENABLE_LCAO=OFF -DUSE_ELPA=OFF
    cmake --build build-prod -j2

  • Ran targeted MD tests successfully:
    ctest --test-dir build-mpi-test -R 'MODULE_MD' --output-on-failure

All targeted MODULE_MD tests passed.

Copilot AI review requested due to automatic review settings May 30, 2026 16:03
@mohanchen
Copy link
Copy Markdown
Collaborator

Great work. Feel free to proceed with your planned optimizations. One reminder: MD simulations consume significant memory for large systems, so try to minimize array usage. In the final testing phase, please use systems with a larger number of atoms.

@Audrey-777 Audrey-777 closed this May 31, 2026
@Audrey-777 Audrey-777 deleted the refactor/md-factory-code-only branch May 31, 2026 04:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants