Skip to content

Fix issue #211 - #212

Merged
lohedges merged 1 commit into
develfrom
fix_211
Sep 21, 2026
Merged

lohedges merged 1 commit into
develfrom
fix_211

Conversation

@lohedges

Copy link
Copy Markdown
Contributor

Closes #211. _save_energy_components() now records each row in a per-window buffer and the new _flush_energy_components() writes the buffered rows in one append from the base _checkpoint(), which both runners go through and which already holds the checkpoint lock. Previously every energy save called parquet_append(), which reads the whole file and rewrites it, costing 3.8 ms per replica per cycle on a 46646 atom system against 90 ms of dynamics at 1 ps cycles, and growing with the length of the run. The components file is now consistent with the other checkpoint files, where before it was written outside the lock and could run ahead of the checkpointed energies; a crash loses at most one checkpoint interval of components, as it already did for the energies. Restart deduplication is unchanged, since it reads the file's last time on the first save after a restart. To bound memory when checkpoints are rare or disabled, the buffer is also written out whenever it reaches 10000 rows, which is a few megabytes and one extra append per 10000 saves.

Three tests are added in tests/runner/test_energy_components.py: one runs both runners for 12 fs, restarts to 24 fs, and checks the file holds one row per energy save with no duplicates; one counts calls on the RepexRunner and checks six saves produce two flushes and six rows; and one lowers the row limit and checks it triggers the extra flushes without duplicating rows.

@lohedges lohedges added the bug Something isn't working label Sep 21, 2026
@lohedges
lohedges deployed to somd2-build September 21, 2026 12:00 — with GitHub Actions Active
@lohedges
lohedges deployed to somd2-build September 21, 2026 12:00 — with GitHub Actions Active
@lohedges
lohedges deployed to somd2-build September 21, 2026 12:00 — with GitHub Actions Active
@lohedges
lohedges deployed to somd2-build September 21, 2026 12:00 — with GitHub Actions Active
@lohedges
lohedges merged commit 30db6c4 into devel Sep 21, 2026
4 checks passed
@lohedges
lohedges deleted the fix_211 branch September 21, 2026 12:11

This branch was successfully deployed

1 active deployment
somd2-build — 1d8c6018 Deployed Sep 21, 2026 by lohedges via build (3.12, macos) #105
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Energy components are appended to parquet every cycle by rewriting the whole file

1 participant