Hello,

I have a code that I want to run multiple times with different random inputs to compute an average overall all iterations.

To get more familiar with parallel programming in Julia, I tried to play around with a small example :

```
n = 10^3
A = SharedArray{Int}(n)
@time begin
@sync @parallel for i in 1:n
A[i] = i
end
end
```

I ran it a few times and I got some disappointing results.

For n = 10^3, I got

For n = 10^5, I got

For n = 10^7, I got

It seems a bit faster to use `julia -p 2`

than `julia -p 1`

, but it is definitely faster to use only `julia`

.

I also try without the parallel stuff and obtain faster times. More precisely, for n = 10^3, 10^5, 10^7, I get

Finally, I also ran the code on a cluster and got similar results.

Am I doing something wrong or is there a problem with parallel programming in Julia?