-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Labels
Description
To make optimal use of pyAMReX, code bindings, performance per se, etc. we are undergoing a general modernization of particle data structures in AMReX.
I encourage all AMReX codes that use particles to follow the modernizations, which will not only provide more performance but also a more seamless Python, AI/ML, and code coupling experience.
First step (2023)
- Transition to PureSoA particles for easier layout, faster performance and potential better SIMD performance.
- The implementation is now available since 2023 and well-tested in BLAST codes [1], [2], [3].
- Status: transition now. We will drop support for AoS to focus development in pyAMReX, see Dropping Support for AoS #459
Second step (2025)
- To simplify code-coupling of different AMReX codes and to reduce compile-time, we transition to
amrex::PolymorphicArenaAllocatorinstead of having separate specializations for host/pinned/device containers. This fixes a long-standing design issue in ParticleContainer that was solved better in AMReXMultiFab. - Transition after Specialize a Polymorphic ParticleContainer #428 was implemented.
- First tests show that this change is indeed performance-neutral and reduces pyAMReX compile- and link time dramatically.
Third step - Soon (2025/26+)
- For maximum runtime compatibility of AMReX codes and better modularity, we will add a new runtime-component-only particle type (of pure SoA).
- The way AMReX particle compute pattern are performed (pointer unwrapping on the host before the kernel), there will be no performance impact (after [WIP] Add simpler version of ParticleTile using 2D array amrex#4404 )
- This will reduce type complexity, and shrink compile- and link-time of specialized PC types to a minimum.
- With this, all AMReX codes can use the exact same PC type, increasing compatibility (handling at runtime) & aiding modular design.
BenWibking and jlvay