I am trying to create a parallel for loop using @parallel, in order to compute a cumulative sum of a SharedArray. A simple test I'm running looks like this:
p = SharedArray{Float64}(10,10);
@parallel for i = 1 : 5
p = p .+ 1
end
p
However, when printing p, I just get a series of zeros, as if the for loop never happened. I have tested that the code actually enters the for loop by having it print on each loop.
I realize that this question may possibly have a straightforward answer to many people, but following the Julia manual and looking for answers online has not lead me to a solution so far.
Thanks in advance,
Simos