Adapt verlet list to npt simulations#172
Merged
Merged
Conversation
Owner
|
Can you do the same for the CPU implementation, and add tests for both? |
Owner
|
cscs-ci run |
Luthaf
reviewed
Jun 23, 2026
jameskermode
added a commit
to jameskermode/vesin
that referenced
this pull request
Jun 23, 2026
Make the device backend stateful so Vesin's own Verlet skin reuse spans steps instead of reimplementing a displacement check in the adapter: - VesinDeviceNeighborList(skin=) holds a persistent NeighborList, rebuilt only when the cutoff changes; build_device calls .compute on it so Vesin decides rebuild-vs-reuse internally (and gains NPT box-change reuse once Luthaf#172 lands). - needs_rebuild now returns a device-resident True (a no-op signal): the consumer always calls build_device and Vesin makes reuse cheap. - device_neighbor_list(skin=) plumbs the skin through the factory. Tests updated: needs_rebuild delegation + a skin>0 reuse-correctness check (reused list still matches a fresh build, since Vesin filters to the true cutoff on reuse). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Author
|
cscs-ci run |
Owner
|
cscs-ci run (@GardevoirX I also added you to the config, so you can trigger CI next time) |
Luthaf
approved these changes
Jun 24, 2026
Owner
|
Thanks @GardevoirX! |
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.
Currently we rebuild the verlet list every time the box changes, which prohibits the application of verlet list to npt simulations.
By following lammps's implementation (see below), I adapted it, and tested on a 1k atoms system. By setting
skin=2.0, the simulation performance changed from4.4e-2 s/stepto3.7e-2 s/stephttps://github.com/lammps/lammps/blob/3bfc12b02799eedf79d779d66fad8c4c60554084/src/neighbor.cpp#L2434-L2448