Closed WeiqunZhang closed 10 months ago
Hipace has AMREX_SPACEDIM == 3
but the array for DepositCurrent is only 2D with a length in the z direction of one. I think lockAdd would then only have one lock which probably would result in bad performance.
Yes, I overlooked that. Let me try to handle that in amrex.
The new amrex::BaseFab::lockAdd function is an optimized version of atomicAdd for OpenMP. In my testing on Frontier CPUs, it's up to 10x faster. I did not test the new function using hipace. But I used https://github.com/WeiqunZhang/amrex-devtests/tree/main/fab_atomicAdd for testing.
const
isconst
)