Skip to content

Conversation

@RudolfWeeber
Copy link
Contributor

@RudolfWeeber RudolfWeeber commented Nov 27, 2025

Fixes #5211

Make the back-applications of forces/torques serial to avoid the race condition when adding forces/torques from several vs to the same reference particle. The test is extended from 2 to 100 virtual sites, such that it would be likely to catch a race condition (and does without the fix).

An optional bool parallel parameter to CellStructure::for_each_local_particle() was added, with true as default. This way, parallelism can be disabled for individual calls.

@RudolfWeeber RudolfWeeber marked this pull request as ready for review November 28, 2025 12:17
@jngrad jngrad changed the title Fix VS Relative reace condition Make VS relative thread-safe Dec 2, 2025
@jngrad jngrad merged commit 3cf4c29 into espressomd:python Dec 2, 2025
10 of 11 checks passed
@jngrad jngrad added the BugFix label Dec 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Relative virtual sites aren't thread-safe

2 participants