diff options
author | 2021-01-21 11:33:38 -0800 | |
---|---|---|
committer | 2021-01-21 11:33:38 -0800 | |
commit | 16ba48a9ae1c28817481007ba93cc20aedba9cf2 (patch) | |
tree | b39c60ca874eedff8006386ad4593ae94855509d /Source/Parallelization/WarpXComm.cpp | |
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/Parallelization/WarpXComm.cpp')
-rw-r--r-- | Source/Parallelization/WarpXComm.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/Parallelization/WarpXComm.cpp b/Source/Parallelization/WarpXComm.cpp index c018a49e5..71cd60723 100644 --- a/Source/Parallelization/WarpXComm.cpp +++ b/Source/Parallelization/WarpXComm.cpp @@ -79,7 +79,7 @@ WarpX::UpdateAuxilaryDataStagToNodal () #endif // For level 0, we only need to do the average. -#ifdef _OPENMP +#ifdef AMREX_USE_OMP #pragma omp parallel if (Gpu::notInLaunchRegion()) #endif for (MFIter mfi(*Bfield_aux[0][0]); mfi.isValid(); ++mfi) @@ -163,7 +163,7 @@ WarpX::UpdateAuxilaryDataStagToNodal () Btmp[i]->ParallelCopy(*Bfield_aux[lev-1][i], 0, 0, 1, ng, ng, cperiod); } -#ifdef _OPENMP +#ifdef AMREX_USE_OMP #pragma omp parallel if (Gpu::notInLaunchRegion()) #endif for (MFIter mfi(*Bfield_aux[lev][0]); mfi.isValid(); ++mfi) @@ -213,7 +213,7 @@ WarpX::UpdateAuxilaryDataStagToNodal () Etmp[i]->ParallelCopy(*Efield_aux[lev-1][i], 0, 0, 1, ng, ng, cperiod); } -#ifdef _OPENMP +#ifdef AMREX_USE_OMP #pragma omp parallel if (Gpu::notInLaunchRegion()) #endif for (MFIter mfi(*Efield_aux[lev][0]); mfi.isValid(); ++mfi) @@ -280,7 +280,7 @@ WarpX::UpdateAuxilaryDataSameType () const amrex::IntVect& By_stag = Bfield_aux[lev-1][1]->ixType().toIntVect(); const amrex::IntVect& Bz_stag = Bfield_aux[lev-1][2]->ixType().toIntVect(); -#ifdef _OPENMP +#ifdef AMREX_USE_OMP #pragma omp parallel if (Gpu::notInLaunchRegion()) #endif for (MFIter mfi(*Bfield_aux[lev][0]); mfi.isValid(); ++mfi) @@ -338,7 +338,7 @@ WarpX::UpdateAuxilaryDataSameType () const amrex::IntVect& Ey_stag = Efield_aux[lev-1][1]->ixType().toIntVect(); const amrex::IntVect& Ez_stag = Efield_aux[lev-1][2]->ixType().toIntVect(); -#ifdef _OPENMP +#ifdef AMREX_USE_OMP #pragma omp parallel if (Gpu::notInLaunchRegion()) #endif for (MFIter mfi(*Efield_aux[lev][0]); mfi.isValid(); ++mfi) |