Skip to content

Commit

Permalink
FFTW: Initialize Threads
Browse files Browse the repository at this point in the history
Co-authored-by: Severin Diederichs <severin.diederichs@desy.de>
  • Loading branch information
ax3l and SeverinDiederichs committed Jun 28, 2021
1 parent a681153 commit 63ad145
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Source/FieldSolver/SpectralSolver/WrapFFTW.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2019-2020
/* Copyright 2019-2021
*
* This file is part of WarpX.
*
Expand Down Expand Up @@ -32,6 +32,16 @@ namespace AnyFFT
{
FFTplan fft_plan;

#if defined(AMREX_USE_OMP) && defined(WarpX_FFTW_OMP)
# ifdef AMREX_USE_FLOAT
fftwf_init_threads();
fftwf_plan_with_nthreads(omp_get_max_threads());
# else
fftw_init_threads();
fftw_plan_with_nthreads(omp_get_max_threads());
# endif
#endif

// Initialize fft_plan.m_plan with the vendor fft plan.
// Swap dimensions: AMReX FAB are Fortran-order but FFTW is C-order
if (dir == direction::R2C){
Expand Down

0 comments on commit 63ad145

Please sign in to comment.