diff --git a/lib/downsam9.f90 b/lib/downsam9.f90 index 575ff7d61..9b5ab66ee 100644 --- a/lib/downsam9.f90 +++ b/lib/downsam9.f90 @@ -41,7 +41,9 @@ subroutine downsam9(id2,npts8,nsps8,newdat,nspsd,fpk,c2,nz2) ! Plan the FFTs just once !$omp critical(fftw) ! serialize non thread-safe FFTW3 calls + call fftwf_plan_with_nthreads(nthreads) plan=fftwf_plan_dft_r2c_1d(nfft1,x1,c1,nflags) + call fftwf_plan_with_nthreads(1) !$omp end critical(fftw) first=.false. diff --git a/lib/filbig.f90 b/lib/filbig.f90 index 26b23c3a8..4c1a687c0 100644 --- a/lib/filbig.f90 +++ b/lib/filbig.f90 @@ -41,7 +41,9 @@ subroutine filbig(dd,npts,f0,newdat,c4a,n4,sq0) ! Plan the FFTs just once !$omp critical(fftw) ! serialize non thread-safe FFTW3 calls + call fftwf_plan_with_nthreads(nthreads) plan1=fftwf_plan_dft_r2c_1d(nfft1,rca,ca,nflags) + call fftwf_plan_with_nthreads(1) plan2=fftwf_plan_dft_1d(nfft2,c4a,c4a,-1,nflags) plan3=fftwf_plan_dft_1d(nfft2,cfilt,cfilt,+1,nflags) !$omp end critical(fftw) diff --git a/lib/jt9.f90 b/lib/jt9.f90 index 217ec44be..515eaad05 100644 --- a/lib/jt9.f90 +++ b/lib/jt9.f90 @@ -79,7 +79,7 @@ program jt9 endif iret=fftwf_init_threads() !Initialize FFTW threading - call fftwf_plan_with_nthreads(nthreads) + call fftwf_plan_with_nthreads(1) !Default to 1 thread but use nthreads for the big ones ! Import FFTW wisdom, if available wisfile=trim(data_dir)//'/jt9_wisdom.dat'// C_NULL_CHAR iret=fftwf_import_wisdom_from_filename(wisfile)