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/FieldSolver/FiniteDifferenceSolver/EvolveF.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source/FieldSolver/FiniteDifferenceSolver/EvolveF.cpp') diff --git a/Source/FieldSolver/FiniteDifferenceSolver/EvolveF.cpp b/Source/FieldSolver/FiniteDifferenceSolver/EvolveF.cpp index fdbab39ea..445b62fb6 100644 --- a/Source/FieldSolver/FiniteDifferenceSolver/EvolveF.cpp +++ b/Source/FieldSolver/FiniteDifferenceSolver/EvolveF.cpp @@ -69,7 +69,7 @@ void FiniteDifferenceSolver::EvolveFCartesian ( amrex::Real const dt ) { // Loop through the grids, and over the tiles within each grid -#ifdef _OPENMP +#ifdef AMREX_USE_OMP #pragma omp parallel if (amrex::Gpu::notInLaunchRegion()) #endif for ( MFIter mfi(*Ffield, TilingIfNotGPU()); mfi.isValid(); ++mfi ) { @@ -122,7 +122,7 @@ void FiniteDifferenceSolver::EvolveFCylindrical ( amrex::Real const dt ) { // Loop through the grids, and over the tiles within each grid -#ifdef _OPENMP +#ifdef AMREX_USE_OMP #pragma omp parallel if (amrex::Gpu::notInLaunchRegion()) #endif for ( MFIter mfi(*Ffield, TilingIfNotGPU()); mfi.isValid(); ++mfi ) { -- cgit v1.2.3