Skip to content

Decouple MD STRU output cadence from out_freq_ion - #8427

Open
19hello wants to merge 6 commits into
deepmodeling:developfrom
19hello:fix/md-test-force-output
Open

19hello wants to merge 6 commits into
deepmodeling:developfrom
19hello:fix/md-test-force-output

Conversation

@19hello

@19hello 19hello commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Extend out_stru with an optional second integer for the periodic MD structure cadence; it defaults to 1.
  • Keep out_freq_ion for electronic and other ionic-step outputs. It does not set MD STRU/CIF cadence.
  • out_stru 1 5 writes a structure frame every five steps. out_stru 1 0 disables periodic STRU frames but still writes STRU_FINAL; restart files remain controlled by md_restartfreq.
  • Reject a negative second value through the shared INPUT error path so all MPI ranks report and exit consistently.
  • Remove the dedicated MD cadence and DP rank consistency validation scripts, their fixtures, and the cadence CTest registration.

Verification

  • cmake --build /tmp/abacus-md-test-force-output-build --target MODULE_IO_input_error_mpi MODULE_IO_read_item_serial -j4 — passed.
  • ctest --test-dir /tmp/abacus-md-test-force-output-build -R '^MODULE_IO_read_item_serial$' --output-on-failure — passed (1/1).
  • ctest --test-dir /tmp/abacus-md-test-force-output-build -R '^MODULE_IO_input_error_mpi_out_stru_negative_frequency$' --output-on-failure — passed (1/1, four MPI ranks).
  • cmake-format --check source/source_io/unittests/CMakeLists.txt — passed.
  • Agent Governance passed on the latest commit. The README metadata workflow initially failed before executing its check because Python 3.8 is unavailable on the Ubuntu 26.04 runner; the workflow now uses Python 3.12 and the rerun passed.
  • The earlier standalone cadence validator was removed from the PR, so it is not listed as current test coverage.

@19hello
19hello force-pushed the fix/md-test-force-output branch from 52ddc54 to d072464 Compare November 27, 2026 11:56
@19hello 19hello changed the title fix(md): decouple STRU cadence and restore test_force diagnostics Decouple MD STRU output cadence from out_freq_ion Nov 27, 2026
@mohanchen mohanchen added MD & LAM MD and Larege Atomic Models Input&Output Suitable for coders without knowing too many DFT details Refactor Refactor ABACUS codes labels Nov 27, 2026

@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.

The new negative-cadence check needs the shared input-error path so all MPI ranks reject the input consistently. The valid-input cadence, final-structure and restart paths are consistent in the source trace; one nonblocking cleanup is noted inline.

Static review only; no builds or runtime tests were run.

@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.

Both earlier findings are addressed in c126a5e88. I found no new implementation defect in the reviewed changes; two nonblocking notes below concern regression coverage removed by this update.

Static review only; no builds or runtime tests were run.

find_program(ABACUS_CADENCE_PYTHON python3)
if(ABACUS_CADENCE_PYTHON AND NOT ENABLE_ASAN)
add_test(
NAME 04_FF_md_output_cadence

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.

Non-blocking: Please keep a small end-to-end MD cadence case when removing this CTest. The remaining parser and literal-frequency helper tests would still pass if md_line read out_freq_ion again. A case with out_stru 1 2, out_freq_ion 0, and md_restartfreq 3, plus a zero-cadence case, would protect the periodic, final, and checkpoint file contract.

if len(serial_frames) != len(parallel_frames) or len(serial_frames) < minimum_frames:
raise AssertionError("{} has {} one-rank and {} four-rank evaluations".format(
label, len(serial_frames), len(parallel_frames)))
tolerances = [1e-5] + [1e-4] * 6 + [1e-3] * 9

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.

Non-blocking: Please preserve this model-backed rank comparison in the existing validation harness. It checks energy and every force/stress component with empty ranks and repeated geometry changes; the retained Al MD and finiteness tests do not cover those same cases. Keep the external-model prerequisite documented.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Input&Output Suitable for coders without knowing too many DFT details MD & LAM MD and Larege Atomic Models Refactor Refactor ABACUS codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants