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?

Reply via email to