Skip to content

Speed up checkpointing large systems from SOMD2 - #510

Merged
lohedges merged 8 commits into
develfrom
feature_optimise_somd2_checkpoint
Oct 20, 2026
Merged

lohedges merged 8 commits into
develfrom
feature_optimise_somd2_checkpoint

Conversation

@lohedges

Copy link
Copy Markdown
Contributor

Profiling checkpoints of a large replica exchange system in SOMD2 showed that most of the time was spent creating and destroying Sire objects for every molecule, with the GIL held, so replicas checkpointed in parallel mostly took turns.

  • Release the GIL when updating a System or deleting its frames, and add a private _free() to System and SelectorMol to destroy large objects without it.
  • Skip loading the current frame when saving DCD, TRR or XTC trajectories, since every frame is written from the trajectory itself.
  • Add DCD.concatenate() to join DCD files without a topology, with frame times set from a timestep and start time.
  • Fix DCD frames being read from the file twice.

Together with the matching SOMD2 changes, normal checkpoints of a 137,000-atom ABFE system are about 2.7 times faster, and the final checkpoint, which joins the trajectories, went from about 4.5 minutes to 13 seconds.

Profiled and written with assistance from Claude Code (Opus 5.5).

  • I confirm that I have merged the latest version of devel into this branch before issuing this pull request (e.g. by running git pull origin devel): [y]
  • I confirm that I have added a test for any new functionality in this pull request: [y]
  • I confirm that I have added documentation (e.g. a new tutorial page or detailed guide) for any new functionality in this pull request: [y]
  • I confirm that I have added a changelog entry to the changelog (we will add a link to this PR as part of the review): [y]
  • I confirm that I have permission to release this code under the LGPLv3+ license: [y]

@lohedges lohedges added the enhancement New feature or request label Oct 20, 2026
@lohedges
lohedges deployed to sire-build October 20, 2026 14:54 — with GitHub Actions Active
@lohedges
lohedges deployed to sire-build October 20, 2026 14:54 — with GitHub Actions Active
@lohedges
lohedges deployed to sire-build October 20, 2026 14:54 — with GitHub Actions Active
@lohedges
lohedges deployed to sire-build October 20, 2026 14:54 — with GitHub Actions Active
@lohedges
lohedges deployed to sire-build October 20, 2026 14:54 — with GitHub Actions Active
@lohedges
lohedges merged commit 139a958 into devel Oct 20, 2026
5 checks passed
@lohedges
lohedges deleted the feature_optimise_somd2_checkpoint branch October 20, 2026 17:04

This branch was successfully deployed

1 active deployment
sire-build — 7a4512eb Deployed Oct 20, 2026 by lohedges via build (3.12, windows) #457
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant