JuliaLang / Distributed.jl

Create and control multiple Julia processes remotely for distributed computing. Ships as a Julia stdlib.
https://docs.julialang.org/en/v1/stdlib/Distributed/
MIT License
23 stars 9 forks source link

Think about simplified scoping rules for parallel macros #30

Open malmaud opened 8 years ago

malmaud commented 8 years ago

There seems to be some general confusion amongst the user base for exactly how variable references in an expression passed to one of the parallel macros are resolved and when the value of variables is transferred vs treated as a reference to a global variable on some module defined on the worker.

Part of the problem could be resolved with better documentation, but I also wonder if we can find a set of rules that is more intuitive and robust in the Julia 0.5 timeframe.

Here are some specific issues concerning symbol resolution in parallel macros issues already brought up that we could maybe make some headway on:

malmaud commented 8 years ago

Some short examples that show how fragile the current situation is:

module M
x=1
y=@fetch x
end
# Worker will crash here
x=1
@fetch x+1  # Works
@fetch Main.x+1 # Fails
vtjnash commented 8 years ago

here's another one for the list: https://github.com/JuliaLang/julia/issues/13810 in that issue, the @fetchfrom 2 v macro is fetching the value of v on process 1, by copying it through process 2.

JohnHBrock commented 8 years ago

It's speculative at this point, but considering the number of related issues, can this be added to the 0.6.0 milestone?

amitmurthy commented 7 years ago

The two open issues are related to treatment of module globals and module loading on workers. The main reported issue i.e., scoping w.r.t. parallel macros has been largely addressed by JuliaLang/julia#19594

Should we close this issue?