Skip to content

Conversation

@atmyers
Copy link
Member

@atmyers atmyers commented Oct 9, 2025

This makes a significant performance difference on a problem setup @aeriforme gave me. In this simulation, many particles leave the domain and we need to store them all for analysis.

On development:

TinyProfiler total time across processes [min...avg...max]: 4246 ... 4246 ... 4246

-------------------------------------------------------------------------------------------------------------
Name                                                          NCalls  Excl. Min  Excl. Avg  Excl. Max   Max %
-------------------------------------------------------------------------------------------------------------
ParticleBoundaryBuffer::gatherParticles::resize                 8772       3843       3843       3843  90.49%
WarpXOpenPMDPlot::SeriesFlush()()                                 96      89.46      89.46      89.46   2.11%
ParticleBoundaryBuffer::gatherParticles                          256      58.11      58.11      58.11   1.37%
ParticleContainer::addParticles                                   48      53.54      53.54      53.54   1.26%
ParticleBoundaryBuffer::gatherParticles::filterAndTransform     8772      27.26      27.26      27.26   0.64%

This PR:

TinyProfiler total time across processes [min...avg...max]: 494.6 ... 494.6 ... 494.6

-------------------------------------------------------------------------------------------------------------
Name                                                          NCalls  Excl. Min  Excl. Avg  Excl. Max   Max %
-------------------------------------------------------------------------------------------------------------
ParticleBoundaryBuffer::gatherParticles::resize                 8754      126.3      126.3      126.3  25.53%
WarpXOpenPMDPlot::SeriesFlush()()                                 96       90.3       90.3       90.3  18.26%
ParticleContainer::addParticles                                   48      59.01      59.01      59.01  11.93%
FFT::R2C::forward(in)                                           1934      27.05      27.05      27.05   5.47%
ParticleBoundaryBuffer::gatherParticles::filterAndTransform     8754       26.8       26.8       26.8   5.42%

@AlexanderSinn
Copy link
Contributor

The resize_geometric_grow() function from AMReX-Codes/amrex#4529 could make this simpler

@atmyers atmyers requested review from RemiLehe and aeriforme October 10, 2025 17:08
@atmyers atmyers changed the title [WIP] Make sure we geometrically grow the capacity of the particle buffers Make sure we geometrically grow the capacity of the particle buffers Oct 10, 2025
@atmyers
Copy link
Member Author

atmyers commented Oct 10, 2025

Note that I bumped the AMReX version for AMReX-Codes/amrex#4708

@atmyers atmyers force-pushed the boundary_buffer_resize_fix branch from 160e764 to ccbc4d0 Compare October 10, 2025 23:20
@RemiLehe RemiLehe merged commit 66162ee into BLAST-WarpX:development Oct 11, 2025
50 checks passed
@RemiLehe
Copy link
Member

Thanks a lot for this PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants