Hi,
I’m new to Julia (just installed it yesterday on Ubuntu 18.04) and I ran into a problem. No matter what simple example code using the @parallel macro I download, I don’t get it working. For instance, the code
function p_rand()
n = 10^4
x = @parallel (+) for i in 1:n
sum(rand(10^4))
end
x / n
end
p_rand()
results in
jeroend:~$ julia -p 4 test.jl
ERROR: LoadError: LoadError: UndefVarError: @parallel not defined
Stacktrace:
[1] top-level scope
[2] include at ./boot.jl:317 [inlined]
[3] include_relative(::Module, ::String) at ./loading.jl:1038
[4] include(::Module, ::String) at ./sysimg.jl:29
[5] exec_options(::Base.JLOptions) at ./client.jl:229
[6] _start() at ./client.jl:421
in expression starting at /home/jeroend/test.jl:3
in expression starting at /home/jeroend/test.jl:1
Of course I tried googling “parallel not defined”, but that doesn’t produce any helpful answers. I must be making a stupid mistake, but I can’t figure it out. Is there anyone who could help me out?
Jeroen