Skip to content

Commit

Permalink
Enable tiling in some MFIter loops (#5096)
Browse files Browse the repository at this point in the history
  • Loading branch information
EZoni authored Jul 30, 2024
1 parent 4ac5962 commit c8a2479
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Source/Parallelization/WarpXComm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ WarpX::UpdateAuxilaryDataStagToNodal ()
#ifdef AMREX_USE_OMP
#pragma omp parallel if (Gpu::notInLaunchRegion())
#endif
for (MFIter mfi(*Efield_aux[lev][0]); mfi.isValid(); ++mfi)
for (MFIter mfi(*Efield_aux[lev][0], TilingIfNotGPU()); mfi.isValid(); ++mfi)
{
Array4<Real> const& ex_aux = Efield_aux[lev][0]->array(mfi);
Array4<Real> const& ey_aux = Efield_aux[lev][1]->array(mfi);
Expand All @@ -321,7 +321,7 @@ WarpX::UpdateAuxilaryDataStagToNodal ()
Array4<Real const> const& ey_c = Etmp[1]->const_array(mfi);
Array4<Real const> const& ez_c = Etmp[2]->const_array(mfi);

const Box& bx = mfi.fabbox();
const Box& bx = mfi.growntilebox();
amrex::ParallelFor(bx,
[=] AMREX_GPU_DEVICE (int j, int k, int l) noexcept
{
Expand Down
4 changes: 2 additions & 2 deletions Source/Utils/WarpXMovingWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ WarpX::shiftMF (amrex::MultiFab& mf, const amrex::Geometry& geom,
#pragma omp parallel if (Gpu::notInLaunchRegion())
#endif

for (amrex::MFIter mfi(tmpmf); mfi.isValid(); ++mfi )
for (amrex::MFIter mfi(tmpmf, TilingIfNotGPU()); mfi.isValid(); ++mfi )
{
if (cost && WarpX::load_balance_costs_update_algo == LoadBalanceCostsUpdateAlgo::Timers)
{
Expand All @@ -545,7 +545,7 @@ WarpX::shiftMF (amrex::MultiFab& mf, const amrex::Geometry& geom,
auto const& dstfab = mf.array(mfi);
auto const& srcfab = tmpmf.array(mfi);

const amrex::Box& outbox = mfi.fabbox() & adjBox;
const amrex::Box& outbox = mfi.growntilebox() & adjBox;

if (outbox.ok()) {
if (!useparser) {
Expand Down

0 comments on commit c8a2479

Please sign in to comment.