Skip to content
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

SumBoundary is much less efficient than FillBoundary #3739

Open
AlexanderSinn opened this issue Jan 31, 2024 · 1 comment
Open

SumBoundary is much less efficient than FillBoundary #3739

AlexanderSinn opened this issue Jan 31, 2024 · 1 comment
Assignees

Comments

@AlexanderSinn
Copy link
Member

AlexanderSinn commented Jan 31, 2024

If I understand the code correctly, FillBoundary only iterates over cells close to the boundary,
while SumBoundary copies the entire Field into a temporary array and then copies it back with updated boundaries,
wich is not nessisary for the vast majority of cells in the center of the box.
With one rank and one box SumBoundary is much slower than FillBoundary.
In HiPACE++ I could make a custom single-box local SumBoundary version, but maybe there is a better option from AMReX?

For context: HiPACE++ currently uses FillBoundary for charge and currents, which is wrong, but changing it to SumBoundary increases the total runtime by 5%.

@WeiqunZhang
Copy link
Member

The current implementation of SumBoundary tries to reuse what we have. And the thinking was for large jobs, the MPI communication cost will dominate the local copy cost. We could reimplement the function for efficiency .

@WeiqunZhang WeiqunZhang self-assigned this Jan 31, 2024
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

No branches or pull requests

2 participants