-
Notifications
You must be signed in to change notification settings - Fork 366
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
Support SoA-Only Particles #2878
Merged
atmyers
merged 123 commits into
AMReX-Codes:development
from
Thierry992:particle_soa_refactor
Apr 17, 2023
Merged
Support SoA-Only Particles #2878
atmyers
merged 123 commits into
AMReX-Codes:development
from
Thierry992:particle_soa_refactor
Apr 17, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…amrex into thierry_soa_particle
ax3l
reviewed
Aug 25, 2022
@Thierry992 @atmyers let us make sure this PR is passing this week, because @Thierry992 and @np-eazy will use this in ImpactX for the hackathon next week :) |
This was referenced Apr 27, 2023
This was referenced May 24, 2023
atmyers
pushed a commit
that referenced
this pull request
May 24, 2023
## Summary * fix return by value/reference mismatch of `id()` and `cpu()` with `decltype(auto)` * update `packParticleData` and `unpackParticleData` for PureSoA * change `getSuperParticle` and add `setSuperParticle` for PureSoA. Remaining issue: super particle has redundant/unused fields for positions, id and cpu * update `ConstParticleTileData` for PureSoA * don’t call `getParticleTileData` in `ParticleTile::id()` etc. as this could be very slow if used in a for loop * use if constexpr instead if SFINAE in a number of places * change PODVector constructor so that `getParticleTileData()` won't allocate memory if no runtime components are used ## Additional background Follow-up to #2878. ## Checklist The proposed changes: - [x] 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
This was referenced May 25, 2023
ax3l
added a commit
that referenced
this pull request
May 31, 2023
Follow-up to #2878. The proposed changes: - [x] 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 Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
WeiqunZhang
pushed a commit
that referenced
this pull request
Jun 6, 2023
## Summary Ideally we do not need them, because 2B particles generated per GPU is very low, but we do need this temporarily until we find a way to generalize large id values again for pure SoA particle layouts. cc @AlexanderSinn ## Additional background Follow-up to #2878. ## 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
This was referenced Jun 6, 2023
guj
pushed a commit
to guj/amrex
that referenced
this pull request
Jul 13, 2023
## Summary Remove the `restrict` qualifier from `GpuArray` members in `ParticleTileData`. We see compilation problems with, among others Clang 14.0.6 and AppleClang, for this construct. We expect that using `restrict` (`AMREX_RESTRICT`) on APIs as well as aliased pointers in these arrays before access should be sufficient to prevent that the compiler thinks that individual arrays alias each other in hot loops. ## Additional background - WarpX build regressions since 23.03, e.g., - conda-forge/warpx-feedstock#63 - conda-forge/warpx-feedstock#64 - ECP-WarpX/WarpX#3817 - independently, about to be remove in AMReX-Codes#2878
guj
pushed a commit
to guj/amrex
that referenced
this pull request
Jul 13, 2023
Add support for storing particle positions and ids SoA style. 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 - [x] are likely to significantly affect the results of downstream AMReX users - [ ] include documentation in the code and/or rst files, if appropriate --------- Co-authored-by: Andrew Myers <atmyers2@gmail.com> Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
guj
pushed a commit
to guj/amrex
that referenced
this pull request
Jul 13, 2023
## Summary Update to use the new `ParticleTile` template parameters. ## Additional background Follow-up to AMReX-Codes#2878. ## Checklist The proposed changes: - [x] 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
guj
pushed a commit
to guj/amrex
that referenced
this pull request
Jul 13, 2023
Follow-on to AMReX-Codes#2878 The proposed changes: - [x] 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
added a commit
that referenced
this pull request
Jul 28, 2023
## Summary Add support for pure SoA layouted particle containers for SENSEI. ## Additional background Follow-up to #2878. ## 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 --------- Co-authored-by: Andrew Myers <atmyers2@gmail.com>
atmyers
pushed a commit
that referenced
this pull request
Sep 22, 2023
## Summary When using a PureSoA particle container, trying to access the AoS components will now result in a compile-time error. Previously it still compiled, and I suspect it even allocated memory for AoS. New error message: ``` /hipace/src/Hipace.cpp:1499:39: error: ‘struct amrex::ThisParticleTileHasNoAoS’ has no member named ‘begin’ 1499 | const auto& pos_structs = aos.begin() + nreal; | ^~~~~ ``` Using this I found more places that needed to be updated to account for PureSoA. PureSoA still has the following issues: - [x] I believe it’s not possible to use the binning functions (in `DenseBins.H`) as they require a particle pointer. - [ ] The `ParticleTileData` struct that is used to access SoA data can be very large, over 300 bytes in some cases. I recommend changing the array-of-pointers to a full 2D array. This way ParticleTileData could be as small as 24 bytes (real pointer, int pointer, stride). ## Additional background Follow-up to #2878. ## Checklist The proposed changes: - [x] 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 --------- Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
atmyers
added a commit
that referenced
this pull request
Nov 21, 2023
## Summary Add support for pure SoA layouted particle containers for Ascent. ## Additional background Follow-up to #2878. ## 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 --------- Co-authored-by: Andrew Myers <atmyers2@gmail.com>
guj
pushed a commit
to guj/amrex
that referenced
this pull request
Dec 13, 2023
## Summary Add support for pure SoA layouted particle containers for Ascent. ## Additional background Follow-up to AMReX-Codes#2878. ## 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 --------- Co-authored-by: Andrew Myers <atmyers2@gmail.com>
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Further updates of #2853 where @atmyers and @ax3l can also push to.
Upgrade Guide for C++ API Changes
These PRs show changes to keep using the old layout:
These PRs show changes to use the new layout (pure SoA):
Additional background
Checklist
The proposed changes: