diff options
author | 2019-10-22 10:32:15 -0400 | |
---|---|---|
committer | 2019-10-22 10:32:15 -0400 | |
commit | 42550405dbbffce12e967c73099799e54e0abb9a (patch) | |
tree | a4f94a08289c7c5050227878d8af63d736c1e03a /Source/Particles/MultiParticleContainer.cpp | |
parent | bfb1cf83004e6f02d1767a05fceca8e71fa245fc (diff) | |
download | WarpX-42550405dbbffce12e967c73099799e54e0abb9a.tar.gz WarpX-42550405dbbffce12e967c73099799e54e0abb9a.tar.zst WarpX-42550405dbbffce12e967c73099799e54e0abb9a.zip |
call RedistributeCPU if runtime components are present, even on GPU
Diffstat (limited to '')
-rw-r--r-- | Source/Particles/MultiParticleContainer.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/Source/Particles/MultiParticleContainer.cpp b/Source/Particles/MultiParticleContainer.cpp index 6bf153a01..2b6b95827 100644 --- a/Source/Particles/MultiParticleContainer.cpp +++ b/Source/Particles/MultiParticleContainer.cpp @@ -316,18 +316,25 @@ void MultiParticleContainer::Redistribute () { for (auto& pc : allcontainers) { - pc->RedistributeCPU(); + if ( (pc->NumRuntimeRealComps()>0) || (pc->NumRuntimeIntComps()>0) ) { + pc->RedistributeCPU(); + } else { + pc->Redistribute(); + } } -} -void -MultiParticleContainer::RedistributeLocal (const int num_ghost) -{ - for (auto& pc : allcontainers) { - pc->RedistributeCPU(0, 0, 0, num_ghost); + void + MultiParticleContainer::RedistributeLocal (const int num_ghost) + { + for (auto& pc : allcontainers) { + if ( (pc->NumRuntimeRealComps()>0) || (pc->NumRuntimeIntComps()>0) ) { + pc->RedistributeCPU(0, 0, 0, num_ghost); + } else { + pc->Redistribute(0, 0, 0, num_ghost); + } + } } } - Vector<long> MultiParticleContainer::NumberOfParticlesInGrid (int lev) const { |