aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/PhysicalParticleContainer.cpp
diff options
context:
space:
mode:
authorGravatar Axel Huebl <axel.huebl@plasma.ninja> 2021-01-21 11:33:38 -0800
committerGravatar GitHub <noreply@github.com> 2021-01-21 11:33:38 -0800
commit16ba48a9ae1c28817481007ba93cc20aedba9cf2 (patch)
treeb39c60ca874eedff8006386ad4593ae94855509d /Source/Particles/PhysicalParticleContainer.cpp
parenteef853b9ab231537e2511efa56a415119e791b26 (diff)
downloadWarpX-16ba48a9ae1c28817481007ba93cc20aedba9cf2.tar.gz
WarpX-16ba48a9ae1c28817481007ba93cc20aedba9cf2.tar.zst
WarpX-16ba48a9ae1c28817481007ba93cc20aedba9cf2.zip
Define: _OPENMP -> AMREX_USE_OMP (#1520)
* Define: _OPENMP -> AMREX_USE_OMP Replace the define check of `_OPENMP` with the explicit backend control of `AMREX_USE_OMP` for parallel constructs. Doing so avoids that we accidentially turn on OpenMP, e.g. if a dependency pulls it in for linear algebra, I/O, etc. This can led to confusion if the user explicitly requested a serial build. Also, we might want to use OpenMP functionality here and there for auxiliary functions w/o having to use the AMReX OpenMP backend, i.e. because we compile for GPUs. * Add missing amrex::Gpu::notInLaunchRegion
Diffstat (limited to 'Source/Particles/PhysicalParticleContainer.cpp')
-rw-r--r--Source/Particles/PhysicalParticleContainer.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/Particles/PhysicalParticleContainer.cpp b/Source/Particles/PhysicalParticleContainer.cpp
index 9b8184823..4f484d064 100644
--- a/Source/Particles/PhysicalParticleContainer.cpp
+++ b/Source/Particles/PhysicalParticleContainer.cpp
@@ -586,7 +586,7 @@ PhysicalParticleContainer::AddPlasma (int lev, RealBox part_realbox)
if (do_tiling && Gpu::notInLaunchRegion()) {
info.EnableTiling(tile_size);
}
-#ifdef _OPENMP
+#ifdef AMREX_USE_OMP
info.SetDynamic(true);
#pragma omp parallel if (not WarpX::serialize_ics)
#endif
@@ -683,7 +683,7 @@ PhysicalParticleContainer::AddPlasma (int lev, RealBox part_realbox)
// Update NextID to include particles created in this function
Long pid;
-#ifdef _OPENMP
+#ifdef AMREX_USE_OMP
#pragma omp critical (add_plasma_nextid)
#endif
{
@@ -961,11 +961,11 @@ PhysicalParticleContainer::Evolve (int lev,
}
}
-#ifdef _OPENMP
+#ifdef AMREX_USE_OMP
#pragma omp parallel
#endif
{
-#ifdef _OPENMP
+#ifdef AMREX_USE_OMP
int thread_num = omp_get_thread_num();
#else
int thread_num = 0;
@@ -1419,7 +1419,7 @@ PhysicalParticleContainer::PushP (int lev, Real dt,
const std::array<amrex::Real,3>& dx = WarpX::CellSize(std::max(lev,0));
-#ifdef _OPENMP
+#ifdef AMREX_USE_OMP
#pragma omp parallel
#endif
{
@@ -1587,7 +1587,7 @@ PhysicalParticleContainer::GetParticleSlice (
diagnostic_particles[lev][index];
}
-#ifdef _OPENMP
+#ifdef AMREX_USE_OMP
#pragma omp parallel
#endif
{