Clean up RedistributeCPU#4529
Merged
atmyers merged 20 commits intoAMReX-Codes:developmentfrom Mar 13, 2026
Merged
Conversation
5 tasks
Member
Author
|
Performance test on a 64 core CPU with 8 MPI ranks and 4 threads per rank, warm electron plasma with WarpX Dev: PR: |
Member
Author
|
WarpX CI passes with this change BLAST-WarpX/warpx#6042 |
5 tasks
atmyers
reviewed
Mar 13, 2026
| auto dst_ptd = dst_ptile.getParticleTileData(); | ||
| auto src_ptd = src_ptile[i].getParticleTileData(); | ||
|
|
||
| for (Long j = 0; j < to_copy; ++j) { |
Member
There was a problem hiding this comment.
I would have guessed that this would be slower than the bulk insert operations it is replacing in the case that you have a lot of particles to move locally. But, your benchmark seems to cover this case.
Member
There was a problem hiding this comment.
At any rate, the ultimate plan is to merge this with RedistributeGPU, so it's not an important point.
atmyers
approved these changes
Mar 13, 2026
This file contains hidden or 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
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
This PR simplifies RedistributeCPU to be independent of particle layout in preparation for #4404.
For this, push_back is replaced by a resize with a geometric growth strategy. push_back is error-prone due to having the possibility to desynchronize the sizes of the individual component vectors if used incorrectly.
Additional background
Checklist
The proposed changes: