Skip to content

Commit

Permalink
move pragma omp parallel if before loop on tile
Browse files Browse the repository at this point in the history
  • Loading branch information
lucafedeli88 committed Jan 20, 2025
1 parent 3f76233 commit a8c9a44
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Source/Diagnostics/ParticleIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,15 +261,15 @@ storePhiOnParticles ( PinnedMemoryParticleContainer& tmp,
tmp.NewRealComp("phi");
int const phi_index = tmp.getParticleComps().at("phi");
auto& warpx = WarpX::GetInstance();
#ifdef AMREX_USE_OMP
#pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
#endif
for (int lev=0; lev<=warpx.finestLevel(); lev++) {
const amrex::Geometry& geom = warpx.Geom(lev);
auto plo = geom.ProbLoArray();
auto dxi = geom.InvCellSizeArray();
amrex::MultiFab const& phi = *warpx.m_fields.get(FieldType::phi_fp, lev);

#ifdef AMREX_USE_OMP
#pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
#endif
for (PinnedParIter pti(tmp, lev); pti.isValid(); ++pti) {

auto phi_grid = phi[pti].array();
Expand Down

0 comments on commit a8c9a44

Please sign in to comment.