You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve support for Particles with PolymorphicArenaAllocator (#4603)
## Summary
This PR adds a `SetArena(Arena*)` function to ParticleContainerBase that
allows setting a memory arena that is used for all the particle vectors
if the allocator is PolymorphicArenaAllocator. The function has to be
called before particle tiles are defined.
This functionality is used to fix a bunch of places where a polymorphic
vector would previously not have its arena set properly.
Additionally the `RunOnGpu` logic in `AMReX_WriteBinaryParticleData.H`
is extended to work with a polymorphic allocator.
Uses changes extracted from
#4404.
## Additional background
Previously all components of all particle tiles needed their arena set
individually by the user if PolymorphicArenaAllocator was used. In case
this was done this PR is a braking change due to the
`AMREX_ALWAYS_ASSERT_WITH_MESSAGE(a_arena != nullptr` assert in
`ParticleTile::define()`.
## Checklist
The proposed changes:
- [ ] fix a bug or incorrect behavior in AMReX
- [x] add new capabilities to AMReX
- [ ] changes answers in the test suite to more than roundoff level
- [ ] are likely to significantly affect the results of downstream AMReX
users
- [ ] include documentation in the code and/or rst files, if appropriate
0 commit comments