Skip to content

Conversation

@AlexanderSinn
Copy link
Member

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
  • 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

@atmyers atmyers merged commit 7f21584 into AMReX-Codes:development Aug 13, 2025
75 checks passed
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