From 16ba48a9ae1c28817481007ba93cc20aedba9cf2 Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Thu, 21 Jan 2021 11:33:38 -0800 Subject: 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 --- Source/Particles/MultiParticleContainer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Source/Particles/MultiParticleContainer.cpp') diff --git a/Source/Particles/MultiParticleContainer.cpp b/Source/Particles/MultiParticleContainer.cpp index 9205e14da..07b8f0c4f 100644 --- a/Source/Particles/MultiParticleContainer.cpp +++ b/Source/Particles/MultiParticleContainer.cpp @@ -698,7 +698,7 @@ MultiParticleContainer::doFieldIonization (int lev, auto info = getMFItInfo(*pc_source, *pc_product); -#ifdef _OPENMP +#ifdef AMREX_USE_OMP #pragma omp parallel if (Gpu::notInLaunchRegion()) #endif for (WarpXParIter pti(*pc_source, lev, info); pti.isValid(); ++pti) @@ -1102,7 +1102,7 @@ MultiParticleContainer::doQEDSchwinger () const MultiFab & By = warpx.getBfield(level_0,1); const MultiFab & Bz = warpx.getBfield(level_0,2); -#ifdef _OPENMP +#ifdef AMREX_USE_OMP #pragma omp parallel if (amrex::Gpu::notInLaunchRegion()) #endif for (MFIter mfi(Ex, TilingIfNotGPU()); mfi.isValid(); ++mfi ) @@ -1273,7 +1273,7 @@ void MultiParticleContainer::doQedBreitWheeler (int lev, auto info = getMFItInfo(*pc_source, *pc_product_ele, *pc_product_pos); -#ifdef _OPENMP +#ifdef AMREX_USE_OMP #pragma omp parallel if (Gpu::notInLaunchRegion()) #endif for (WarpXParIter pti(*pc_source, lev, info); pti.isValid(); ++pti) @@ -1334,7 +1334,7 @@ void MultiParticleContainer::doQedQuantumSync (int lev, auto info = getMFItInfo(*pc_source, *pc_product_phot); -#ifdef _OPENMP +#ifdef AMREX_USE_OMP #pragma omp parallel if (Gpu::notInLaunchRegion()) #endif for (WarpXParIter pti(*pc_source, lev, info); pti.isValid(); ++pti) -- cgit v1.2.3