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/RigidInjectedParticleContainer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Source/Particles/RigidInjectedParticleContainer.cpp') diff --git a/Source/Particles/RigidInjectedParticleContainer.cpp b/Source/Particles/RigidInjectedParticleContainer.cpp index 8e91b12bb..d18631ff1 100644 --- a/Source/Particles/RigidInjectedParticleContainer.cpp +++ b/Source/Particles/RigidInjectedParticleContainer.cpp @@ -7,7 +7,7 @@ * * License: BSD-3-Clause-LBNL */ -#ifdef _OPENMP +#ifdef AMREX_USE_OMP # include #endif @@ -82,7 +82,7 @@ RigidInjectedParticleContainer::RemapParticles() for (int lev = 0; lev <= finestLevel(); lev++) { -#ifdef _OPENMP +#ifdef AMREX_USE_OMP #pragma omp parallel if (Gpu::notInLaunchRegion()) #endif { @@ -147,7 +147,7 @@ RigidInjectedParticleContainer::BoostandRemapParticles() const Real csqi = 1./(PhysConst::c*PhysConst::c); -#ifdef _OPENMP +#ifdef AMREX_USE_OMP #pragma omp parallel if (Gpu::notInLaunchRegion()) #endif { @@ -390,7 +390,7 @@ RigidInjectedParticleContainer::PushP (int lev, Real dt, const std::array& dx = WarpX::CellSize(std::max(lev,0)); -#ifdef _OPENMP +#ifdef AMREX_USE_OMP #pragma omp parallel #endif { -- cgit v1.2.3