Skip to content

Adapt verlet list to npt simulations#172

Merged
Luthaf merged 6 commits into
Luthaf:mainfrom
GardevoirX:npt-verlet
Jun 24, 2026
Merged

Adapt verlet list to npt simulations#172
Luthaf merged 6 commits into
Luthaf:mainfrom
GardevoirX:npt-verlet

Conversation

@GardevoirX

Copy link
Copy Markdown
Contributor

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 from 4.4e-2 s/step to 3.7e-2 s/step

https://github.com/lammps/lammps/blob/3bfc12b02799eedf79d779d66fad8c4c60554084/src/neighbor.cpp#L2434-L2448

@Luthaf

Luthaf commented Jun 19, 2026

Copy link
Copy Markdown
Owner

Can you do the same for the CPU implementation, and add tests for both?

@Luthaf

Luthaf commented Jun 23, 2026

Copy link
Copy Markdown
Owner

cscs-ci run

Comment thread vesin/src/verlet.cpp
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>
@GardevoirX

Copy link
Copy Markdown
Contributor Author

cscs-ci run

@Luthaf

Luthaf commented Jun 24, 2026

Copy link
Copy Markdown
Owner

cscs-ci run

(@GardevoirX I also added you to the config, so you can trigger CI next time)

@Luthaf Luthaf merged commit 2c60720 into Luthaf:main Jun 24, 2026
13 checks passed
@Luthaf

Luthaf commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Thanks @GardevoirX!

@GardevoirX GardevoirX deleted the npt-verlet branch June 24, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants