# LoadError @parallel

**URL:** <https://discourse.julialang.org/t/loaderror-parallel/15126>\
**Category:** New to Julia\
**Created:** [September 18, 2018, 11:47am UTC](https://discourse.julialang.org/t/loaderror-parallel/15126 "2018-09-18T11:47:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeroen\_Danon](https://avatars.discourse-cdn.com/v4/letter/j/ac8455/32.png) [@Jeroen\_Danon](https://discourse.julialang.org/u/Jeroen_Danon)\
**Post date:** [September 18, 2018, 11:47am UTC](https://discourse.julialang.org/t/loaderror-parallel/15126/1 "2018-09-18T11:47:40Z")

</div>

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

```julia
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

```julia
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

---

<div class="post-metadata">

**Author:** ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Post date:** [September 18, 2018, 11:52am UTC](https://discourse.julialang.org/t/loaderror-parallel/15126/2 "2018-09-18T11:52:42Z")

</div>

Welcome to Julia!!!

You need to import it via `using Distributed` as `@parallel` has been moved to there with Julia 1.0. (Running this in Julia 0.7 will tell you this.)

PS: have a look at [PSA: how to quote code with backticks](https://discourse.julialang.org/t/psa-how-to-quote-code-with-backticks/7530)

---

<div class="post-metadata">

**Author:** ![Jeroen\_Danon](https://avatars.discourse-cdn.com/v4/letter/j/ac8455/32.png) [@Jeroen\_Danon](https://discourse.julialang.org/u/Jeroen_Danon)\
**Post date:** [September 18, 2018, 12:04pm UTC](https://discourse.julialang.org/t/loaderror-parallel/15126/3 "2018-09-18T12:04:20Z")

</div>

Thank you very much for the quick reply!  
Next time I’ll try to quote the code correctly 🙂

I added a line

```julia
using Distributed

```

to the top of the code, but still get the same error message…

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [September 18, 2018, 12:07pm UTC](https://discourse.julialang.org/t/loaderror-parallel/15126/4 "2018-09-18T12:07:11Z")

</div>

Hasn’t it been renamed to `@distributed`?

---

<div class="post-metadata">

**Author:** ![Jeroen\_Danon](https://avatars.discourse-cdn.com/v4/letter/j/ac8455/32.png) [@Jeroen\_Danon](https://discourse.julialang.org/u/Jeroen_Danon)\
**Post date:** [September 18, 2018, 12:12pm UTC](https://discourse.julialang.org/t/loaderror-parallel/15126/5 "2018-09-18T12:12:47Z")

</div>

Thanks!  
Replaced `@parallel` by `@distributed` and the errors are gone!

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [September 18, 2018, 1:13pm UTC](https://discourse.julialang.org/t/loaderror-parallel/15126/6 "2018-09-18T13:13:26Z")

</div>

You might want to consider using 0.7 for now if you’re running a lot of code that was written on older Julia versions, as it shows you deprecation warnings where v1.0 errors out: [PSA: use Julia 0.7 if you are upgrading](https://discourse.julialang.org/t/psa-use-julia-0-7-if-you-are-upgrading/13321)
