Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor particle insertion code #4493

Merged
merged 8 commits into from
Apr 11, 2022
Merged

Conversation

jngrad
Copy link
Member

@jngrad jngrad commented Apr 7, 2022

Fixes #4447

Description of changes:

  • cache the largest particle id to make particle insertion run in constant time
  • fix regressions in the particle insertion code that raised NameError and numpy.VisibleDeprecationWarning
  • prevent particles from excluding themselves from non-bonded interactions and allow excluding ParticleHandle objects
  • improve separation of concerns and enforce single-responsibility principle:
    • move particle insertion/deletion/caching/tracking logic from particle_data.cpp to particle_node.cpp
    • simplify particle MPI callbacks by splitting the particle insertion code from the particle moving code

jngrad added 7 commits April 6, 2022 17:45
Move particle creation, deletion, storage, cache and tracking logic
to a dedicated source file particle_node.cpp and leave particle
property setters and getters in particle_data.cpp.
Narrow includes of particle_data.hpp and particle_node.hpp.
Make particle creation/deletion functions return void, since
internal details of the particle storage are irrelevant. Make
utility functions private (internal linkage). Replace MPI
primitives by their equivalent boost::mpi functions.
Split callbacks that mixed multiple responsibilities via a flag
into multiple callbacks that have only one responsibility each.
The np.shape() call was raising a numpy deprecation warning on the
virtual sites relative property. The dictionary type check was not
correct and would fall through for any non-dict object.
@jngrad jngrad added the automerge Merge with kodiak label Apr 11, 2022
@kodiakhq kodiakhq bot merged commit 32a46f6 into espressomd:python Apr 11, 2022
@jngrad jngrad deleted the particle_node branch April 11, 2022 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Particle creation too slow in large simulations
2 participants