aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/MultiParticleContainer.cpp
diff options
context:
space:
mode:
authorGravatar Edoardo Zoni <59625522+EZoni@users.noreply.github.com> 2023-07-27 13:18:06 -0700
committerGravatar GitHub <noreply@github.com> 2023-07-27 13:18:06 -0700
commit1f1b15b7b018c95025ce7afebd5e0b350d60f610 (patch)
tree1540ed089d1b902b811458b85ae42da425bf9f87 /Source/Particles/MultiParticleContainer.cpp
parent3b804c1559345be370b4a733c1eccfa41d5c7334 (diff)
downloadWarpX-1f1b15b7b018c95025ce7afebd5e0b350d60f610.tar.gz
WarpX-1f1b15b7b018c95025ce7afebd5e0b350d60f610.tar.zst
WarpX-1f1b15b7b018c95025ce7afebd5e0b350d60f610.zip
Fix bug with MLMG solver, always pass ghost cells to `SumBoundary` (#4078)
* Must pass number of ghost cells to call `SumBoundary` * Apply suggestions from #4093 * Add inline comments on possible performance optimization
Diffstat (limited to 'Source/Particles/MultiParticleContainer.cpp')
-rw-r--r--Source/Particles/MultiParticleContainer.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/Particles/MultiParticleContainer.cpp b/Source/Particles/MultiParticleContainer.cpp
index 7bbb973bb..529a78c8e 100644
--- a/Source/Particles/MultiParticleContainer.cpp
+++ b/Source/Particles/MultiParticleContainer.cpp
@@ -613,7 +613,11 @@ MultiParticleContainer::GetChargeDensity (int lev, bool local)
}
if (!local) {
const Geometry& gm = allcontainers[0]->Geom(lev);
- ablastr::utils::communication::SumBoundary(*rho, WarpX::do_single_precision_comms, gm.periodicity());
+ // Possible performance optimization:
+ // pass less than `rho->nGrowVect()` in the fifth input variable `dst_ng`
+ ablastr::utils::communication::SumBoundary(
+ *rho, 0, rho->nComp(), rho->nGrowVect(), rho->nGrowVect(),
+ WarpX::do_single_precision_comms, gm.periodicity());
}
return rho;