Skip to content

SumBoundary is much less efficient than FillBoundary #3739

@AlexanderSinn

Description

@AlexanderSinn

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%.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions