diff options
author | 2021-01-21 11:33:38 -0800 | |
---|---|---|
committer | 2021-01-21 11:33:38 -0800 | |
commit | 16ba48a9ae1c28817481007ba93cc20aedba9cf2 (patch) | |
tree | b39c60ca874eedff8006386ad4593ae94855509d /Source/FieldSolver/FiniteDifferenceSolver | |
parent | eef853b9ab231537e2511efa56a415119e791b26 (diff) | |
download | WarpX-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/FieldSolver/FiniteDifferenceSolver')
8 files changed, 12 insertions, 12 deletions
diff --git a/Source/FieldSolver/FiniteDifferenceSolver/ComputeDivE.cpp b/Source/FieldSolver/FiniteDifferenceSolver/ComputeDivE.cpp index baadd0cfc..bcc7c4460 100644 --- a/Source/FieldSolver/FiniteDifferenceSolver/ComputeDivE.cpp +++ b/Source/FieldSolver/FiniteDifferenceSolver/ComputeDivE.cpp @@ -63,7 +63,7 @@ void FiniteDifferenceSolver::ComputeDivECartesian ( amrex::MultiFab& divEfield ) { // 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(divEfield, TilingIfNotGPU()); mfi.isValid(); ++mfi ) { @@ -109,7 +109,7 @@ void FiniteDifferenceSolver::ComputeDivECylindrical ( amrex::MultiFab& divEfield ) { // 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(divEfield, TilingIfNotGPU()); mfi.isValid(); ++mfi ) { diff --git a/Source/FieldSolver/FiniteDifferenceSolver/EvolveB.cpp b/Source/FieldSolver/FiniteDifferenceSolver/EvolveB.cpp index 0ca576da2..338cc31f9 100644 --- a/Source/FieldSolver/FiniteDifferenceSolver/EvolveB.cpp +++ b/Source/FieldSolver/FiniteDifferenceSolver/EvolveB.cpp @@ -63,7 +63,7 @@ void FiniteDifferenceSolver::EvolveBCartesian ( 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(*Bfield[0], TilingIfNotGPU()); mfi.isValid(); ++mfi ) { @@ -122,7 +122,7 @@ void FiniteDifferenceSolver::EvolveBCylindrical ( 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(*Bfield[0], TilingIfNotGPU()); mfi.isValid(); ++mfi ) { diff --git a/Source/FieldSolver/FiniteDifferenceSolver/EvolveBPML.cpp b/Source/FieldSolver/FiniteDifferenceSolver/EvolveBPML.cpp index 6fc157653..fbc62f661 100644 --- a/Source/FieldSolver/FiniteDifferenceSolver/EvolveBPML.cpp +++ b/Source/FieldSolver/FiniteDifferenceSolver/EvolveBPML.cpp @@ -64,7 +64,7 @@ void FiniteDifferenceSolver::EvolveBPMLCartesian ( const bool dive_cleaning) { // 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(*Bfield[0], TilingIfNotGPU()); mfi.isValid(); ++mfi ) { diff --git a/Source/FieldSolver/FiniteDifferenceSolver/EvolveE.cpp b/Source/FieldSolver/FiniteDifferenceSolver/EvolveE.cpp index db1d1fe1b..3762d3f71 100644 --- a/Source/FieldSolver/FiniteDifferenceSolver/EvolveE.cpp +++ b/Source/FieldSolver/FiniteDifferenceSolver/EvolveE.cpp @@ -71,7 +71,7 @@ void FiniteDifferenceSolver::EvolveECartesian ( Real constexpr c2 = PhysConst::c * PhysConst::c; // 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(*Efield[0], TilingIfNotGPU()); mfi.isValid(); ++mfi ) { @@ -165,7 +165,7 @@ void FiniteDifferenceSolver::EvolveECylindrical ( 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(*Efield[0], TilingIfNotGPU()); mfi.isValid(); ++mfi ) { diff --git a/Source/FieldSolver/FiniteDifferenceSolver/EvolveEPML.cpp b/Source/FieldSolver/FiniteDifferenceSolver/EvolveEPML.cpp index d5ef1179b..f93f68414 100644 --- a/Source/FieldSolver/FiniteDifferenceSolver/EvolveEPML.cpp +++ b/Source/FieldSolver/FiniteDifferenceSolver/EvolveEPML.cpp @@ -76,7 +76,7 @@ void FiniteDifferenceSolver::EvolveEPMLCartesian ( Real constexpr c2 = PhysConst::c * PhysConst::c; // 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(*Efield[0], TilingIfNotGPU()); mfi.isValid(); ++mfi ) { 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 ) { diff --git a/Source/FieldSolver/FiniteDifferenceSolver/EvolveFPML.cpp b/Source/FieldSolver/FiniteDifferenceSolver/EvolveFPML.cpp index cdcab750d..1a49316dd 100644 --- a/Source/FieldSolver/FiniteDifferenceSolver/EvolveFPML.cpp +++ b/Source/FieldSolver/FiniteDifferenceSolver/EvolveFPML.cpp @@ -62,7 +62,7 @@ void FiniteDifferenceSolver::EvolveFPMLCartesian ( 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 ) { diff --git a/Source/FieldSolver/FiniteDifferenceSolver/MacroscopicEvolveE.cpp b/Source/FieldSolver/FiniteDifferenceSolver/MacroscopicEvolveE.cpp index 4a2d940aa..448c9b57d 100644 --- a/Source/FieldSolver/FiniteDifferenceSolver/MacroscopicEvolveE.cpp +++ b/Source/FieldSolver/FiniteDifferenceSolver/MacroscopicEvolveE.cpp @@ -94,7 +94,7 @@ void FiniteDifferenceSolver::MacroscopicEvolveECartesian ( // 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(*Efield[0], TilingIfNotGPU()); mfi.isValid(); ++mfi ) { |