add multithreading support via Threads.@spawn?
hi
i was wondering whether there is any scope to add multithreading support to this library. i read this https://julialang.org/blog/2019/07/multithreading/ and i was hoping one could think about the interpolation loop here in the same way as in their psort! example? like thread number 1 interpolates the first half of points, thread 2 the second half?
Which loop? Most of the package is devoted to supporting itp(x, y, ...), and there's no way threading will help that particular operation. Prefiltering might be one area where it would make sense, and perhaps there would be others.
A PR would certainly be evaluated, but it would have to include benchmarks.
Oh. I was thinking if I want to evaluate an interpolation object at many points, it might make sense to split that operation amongst threads. I was king of assuming there is a loop somewhere involved - nevermind if that’s not the case.
On Mon 10 Feb 2020 at 20:14, Tim Holy [email protected] wrote:
Which loop? Most of the package is devoted to supporting itp(x, y, ...), and there's no way threading will help that particular operation. Prefiltering might be one area where it would make sense, and perhaps there would be others.
A PR would certainly be evaluated, but it would have to include benchmarks.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JuliaMath/Interpolations.jl/issues/356?email_source=notifications&email_token=AAHZM5X755GNCTOITCJH6OTRCGRPXA5CNFSM4KSQ2N4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELJ336Q#issuecomment-584302074, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHZM5R2YNHEQF3QGKJGDCDRCGRPXANCNFSM4KSQ2N4A .
How are you evaluating it?
I would do something like
out = interpolate((xvec,),yvec,Gridded(Linear()))(newx)
where newx has many values.
Oh, I see, yes, if you're using vectorized evaluation then it would make sense. Want to try a PR?
i can try. if you can point me to where I need to start digging 😃 . thanks!
Just try @edit itp(newx) and see where it takes you. It will almost certain be the top-level function.