-
Notifications
You must be signed in to change notification settings - Fork 665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
partr threads backend #175
Comments
cc @vtjnash who is reportedly interested in this. |
For anyone who is interested in working on this, essentially you just need to implement 3-4 functions in FFTW — see the OpenMP backend and the pthreads backend:
( |
Current plan: Add a "callback_threads" backend to FFTW where the user has to call a This has several advantages: it allows us to implement |
I've looked at it a bit more, and implemented something even simpler:
If you call |
In Julia, something like function spawnloop(f::Ptr{Cvoid}, fdata::Ptr{Cvoid}, elsize::Csize_t, num::Cint, callback_data::Ptr{Cvoid})
@sync for i = 0:num-1
@spawn ccall(f, Ptr{Cvoid}, (Ptr{Cvoid},), fdata + elsize*i)
end
end and then, in the cspawnloop = @cfunction(spawnloop, Cvoid, (Ptr{Cvoid}, Ptr{Cvoid}, Csize_t, Cint, Ptr{Cvoid}))
ccall((:fftwf_threads_set_callback, libfftw3f), Cvoid, (Ptr{Cvoid}, Ptr{Cvoid}), cspawnloop, C_NULL)
ccall((:fftw_threads_set_callback, libfftw3), Cvoid, (Ptr{Cvoid}, Ptr{Cvoid}), cspawnloop, C_NULL) |
Update: we just tried it on @vtjnash's machine, and it works! 3x speedup for a size-64k FFT on a 4-core machine, using the partr runtime, which is quite respectable. |
This basically reverts Blosc#224 My arguments: - Compiling this as-is errors because of undefined references to InitOnceBeginInitialize, InitOnceComplete (due to missing winnt defines) - One can always statically link to winpthreads to avoid the dependency to the extra dll - Also winpthreads has more efficient code cc @stevengj
Hi all, Currently trying Julia 1.3-alpha1 on Windows (not my preferred platform :). Package precompilation is breaking due to calls to My platform is
I can run an FFT:
Alas, check this out:
Any clues? |
Is it using a different version of the FFTW library in the two cases? Does using FFTW
pathof(FFTW) give |
Also, please don't file Julia-specific issues here. If you have further trouble, please file an issue at https://github.com/JuliaMath/FFTW.jl |
Hi Steven, Many thanks, see the issue opened here. |
For use with Julia 1.3's upcoming parallel scheduler in a few months, it would be nice to add an optional threading backend for the partr scheduler to FFTW.
The easiest thing here would be to use
fftw_plan_with_nthreads(n)
as usual, but instead ofn
threads it would queuen
partr tasks.Seems like it should be straightforward, but would need some kind of documented C API in partr like
partr_spawn(callback_function, dataptr)
andpartr_sync
? cc @kpamnany, @JeffBezanson.The text was updated successfully, but these errors were encountered: