Cuba.jl icon indicating copy to clipboard operation
Cuba.jl copied to clipboard

Support parallelization

Open giordano opened this issue 8 years ago • 7 comments

I'm not sure it's actually feasible, but it would be great if Cuba.jl could take advantage of parallelization capability of Cuba Library. Concurrency is achieved using fork and wait, but trying to increase the number of Cuba cores in Cuba.jl, after having increased the number of Julia processes with addprocs (without this, Cuba will spawn useless Julia processes), results in an undefined reference to fork function.

giordano avatar Apr 10 '16 00:04 giordano

Following up on your comment to https://github.com/JuliaLang/julia/issues/8295, Stefan once suggested one could use ccall to call fork. Maybe that would work for you.

tshort avatar Jul 18 '16 21:07 tshort

Thanks for your comment, but I don't think your suggestion is feasible in this case as I never call directly fork, but functions that internally spawn slave processes.

giordano avatar Jul 18 '16 22:07 giordano

A hack using fork with Julia is https://github.com/amitmurthy/PTools.jl#pfork - though I don't see how this will be useful in your scenario with fork being called from within the library.

amitmurthy avatar Jul 19 '16 05:07 amitmurthy

Thanks to you as well. As I said in the Julia issue, I'm not sure that supporting fork in Julia would solve this problem, but what I'm experiencing is that if Cuba.jl tries to use fork new processes it crashes due to undefined reference to fork function.

giordano avatar Jul 19 '16 08:07 giordano

For now there's a pure Julia vegas method here which supports parallelization: https://github.com/ranjanan/MonteCarloIntegration.jl

ChrisRackauckas avatar Aug 05 '19 14:08 ChrisRackauckas

Instead of parallelizing on the binary side, could it instead have a batch interface to let the user parallelize over the evaluation points?

ChrisRackauckas avatar Aug 05 '19 14:08 ChrisRackauckas

It does already support vectorisation: https://giordano.github.io/Cuba.jl/stable/#Vectorization-1. Example here: https://giordano.github.io/Cuba.jl/stable/#Vectorized-Function-1

giordano avatar Aug 05 '19 15:08 giordano