Conversation
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 calledparquet_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 theRepexRunnerand 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.