JuliaMath / FFTW.jl

Julia bindings to the FFTW library for fast Fourier transforms
https://juliamath.github.io/FFTW.jl/stable
MIT License
273 stars 55 forks source link

Building with multiple threads breaks remotecalls of plan_fft #135

Open dsweber2 opened 4 years ago

dsweber2 commented 4 years ago

I have a package that uses distributed and creates a different fft plan for each process. When I build with more than 1 thread, it becomes incredibly slow to create the fft_plans (order of 12 hours for something that should take <1s), regardless of how many threads I actually use in that Julia process. For the purposes of debugging I've made a (mostly) minimal example here. I tried to make an example that works in just the RePL, but it appears that the building is an important aspect. For now I'm planning on specifying in the build that there should only be one thread, but I'm not sure how this would interact with ClusterManagers, where having both threaded ffts and different processes would definitely be useful.

Steps to reproduce:

  1. set JULIA_NUM_THREADS=4 based on environment
  2. using Pkg
    Pkg.add("https://github.com/dsweber2/minimalFreezingExample.jl.git")
    Pkg.build("minimalFreezingExample")
    Pkg.test("minimalFreezingExample")

    it should hang on i=2, j=1.

This is definitely related to https://github.com/JuliaMath/FFTW.jl/issues/121

stevengj commented 4 years ago

Try calling FFTW.set_num_threads(1)?