Skip to content

Commit 5d1b6c2

Browse files
authored
Fix a bug in #4623 (#4631)
The issue is MakeIter(lev) enables tiling whereas MakeIter(lev, MFItInfo{}) does not. Fix for a bug introduced in #4623
1 parent c59345a commit 5d1b6c2

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Src/Particle/AMReX_ParticleContainerI.H

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,24 +1169,24 @@ addParticles (const PCType& other, F const& f, bool local)
11691169
// touch all tiles in serial
11701170
for (int lev = 0; lev < other.numLevels(); ++lev)
11711171
{
1172+
[[maybe_unused]] Gpu::NoSyncRegion no_sync{};
11721173
const auto& plevel_other = other.GetParticles(lev);
1173-
for(MFIter mfi = other.MakeMFIter(lev, MFItInfo().DisableDeviceSync()); mfi.isValid(); ++mfi)
1174+
for(MFIter mfi = other.MakeMFIter(lev); mfi.isValid(); ++mfi)
11741175
{
11751176
auto index = std::make_pair(mfi.index(), mfi.LocalTileIndex());
11761177
if(plevel_other.find(index) == plevel_other.end()) { continue; }
11771178

11781179
DefineAndReturnParticleTile(lev, mfi.index(), mfi.LocalTileIndex());
11791180
}
11801181
}
1181-
Gpu::streamSynchronizeAll();
11821182

11831183
#ifdef AMREX_USE_OMP
11841184
#pragma omp parallel if (Gpu::notInLaunchRegion())
11851185
#endif
11861186
for (int lev = 0; lev < other.numLevels(); ++lev)
11871187
{
11881188
const auto& plevel_other = other.GetParticles(lev);
1189-
for(MFIter mfi = other.MakeMFIter(lev, MFItInfo().DisableDeviceSync()); mfi.isValid(); ++mfi)
1189+
for(MFIter mfi = other.MakeMFIter(lev); mfi.isValid(); ++mfi)
11901190
{
11911191
auto index = std::make_pair(mfi.index(), mfi.LocalTileIndex());
11921192
if(plevel_other.find(index) == plevel_other.end()) { continue; }
@@ -1205,7 +1205,6 @@ addParticles (const PCType& other, F const& f, bool local)
12051205
ptile.resize(dst_index + count);
12061206
}
12071207
}
1208-
Gpu::streamSynchronizeAll();
12091208

12101209
if (! local) { Redistribute(); }
12111210
}

0 commit comments

Comments
 (0)