despite your naming convention, it looks like "local_var" was a global. try wrapping it in a let block:
let local_var=123 @everywhere var=$local_var end On Mon, Oct 5, 2015 at 6:22 PM Gabor <[email protected]> wrote: > I would like to copy a local variable to all parallel workers. > > I thought that the following code would do the job: > local_var=123 > @everywhere var=local_var > > > But I get the following error: > > ERROR: On worker 2: > UndefVarError: local_var not defined > in eval at sysimg.jl:14 > in anonymous at multi.jl:1350 > in anonymous at multi.jl:892 > in run_work_thunk at multi.jl:645 > [inlined code] from multi.jl:892 > in anonymous at task.jl:63 > in remotecall_fetch at multi.jl:731 > > ...and 2 other exceptions. > > in sync_end at task.jl:413 > in anonymous at multi.jl:1361 > > > I ask for your help. > What is the simplest solution for this simple problem? >
