From 42550405dbbffce12e967c73099799e54e0abb9a Mon Sep 17 00:00:00 2001 From: Maxence Thevenet Date: Tue, 22 Oct 2019 10:32:15 -0400 Subject: call RedistributeCPU if runtime components are present, even on GPU --- Source/Particles/MultiParticleContainer.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'Source/Particles/MultiParticleContainer.cpp') 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 MultiParticleContainer::NumberOfParticlesInGrid (int lev) const { -- cgit v1.2.3