From f428f5a26f11d715f1b8800e60f0b29154ce10a6 Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Wed, 30 Jun 2021 15:34:58 -0700 Subject: Add OpenMP for FFTW (#2040) * CMake: Find out if FFTW supports OpenMP Add a heuristics that also works with PkgConfig to query OpenMP support in FFTW. Enable by default if we build with the OpenMP compute backend unless explicitly disabled. Add a macro to control the source-code, since FFTW does not offer a public define for this. * FFTW: Initialize Threads Co-authored-by: Severin Diederichs Co-authored-by: Severin Diederichs --- Source/FieldSolver/SpectralSolver/SpectralFieldData.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Source/FieldSolver/SpectralSolver/SpectralFieldData.cpp') diff --git a/Source/FieldSolver/SpectralSolver/SpectralFieldData.cpp b/Source/FieldSolver/SpectralSolver/SpectralFieldData.cpp index bdb631063..056c030c0 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralFieldData.cpp +++ b/Source/FieldSolver/SpectralSolver/SpectralFieldData.cpp @@ -145,6 +145,8 @@ SpectralFieldData::ForwardTransform (const int lev, #endif // Loop over boxes + // Note: we do NOT OpenMP parallelize here, since we use OpenMP threads for + // the FFTs on each box! for ( MFIter mfi(mf); mfi.isValid(); ++mfi ){ if (cost && WarpX::load_balance_costs_update_algo == LoadBalanceCostsUpdateAlgo::Timers) { @@ -247,6 +249,8 @@ SpectralFieldData::BackwardTransform( const int lev, #endif // Loop over boxes + // Note: we do NOT OpenMP parallelize here, since we use OpenMP threads for + // the iFFTs on each box! for ( MFIter mfi(mf); mfi.isValid(); ++mfi ){ if (cost && WarpX::load_balance_costs_update_algo == LoadBalanceCostsUpdateAlgo::Timers) { -- cgit v1.2.3