Skip to content

Clean up RedistributeCPU #4529

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

Open
wants to merge 9 commits into
base: development
Choose a base branch
from

Conversation

AlexanderSinn
Copy link
Member

Summary

This PR simplifies RedistributeCPU to be independent of particle layout in preparation for #4404.
For this, a resize_geometric_grow() function is added to reduce the reliance on push_back. 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:

  • 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

@AlexanderSinn AlexanderSinn requested a review from atmyers July 8, 2025 16:53
@AlexanderSinn
Copy link
Member Author

AlexanderSinn commented Jul 26, 2025

Performance test on a 64 core CPU with 8 MPI ranks and 4 threads per rank, warm electron plasma with WarpX

amr.n_cell = 128 128 128
amr.max_grid_size = 16
amr.blocking_factor = 16

Dev:

Name                                                       NCalls  Incl. Min  Incl. Avg  Incl. Max   Max %
----------------------------------------------------------------------------------------------------------
ParticleContainer::RedistributeCPU()                          101      1.774      1.782      1.786   7.76%
ParticleContainer::RedistributeCPU()                          101      1.775      1.784      1.787   7.71%
ParticleContainer::RedistributeCPU()                          101      1.823       1.83      1.835   7.95%

PR:

Name                                                       NCalls  Incl. Min  Incl. Avg  Incl. Max   Max %
----------------------------------------------------------------------------------------------------------
ParticleContainer::RedistributeCPU()                          101      1.748      1.787      1.797   7.76%
ParticleContainer::RedistributeCPU()                          101       1.74      1.771      1.778   7.70%
ParticleContainer::RedistributeCPU()                          101       1.73      1.739      1.744   7.56%

@AlexanderSinn
Copy link
Member Author

WarpX CI passes with this change BLAST-WarpX/warpx#6042

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.

1 participant