Running 0.4.0-dev+5933.  I expected the print outs from this code to be the 
same and to equal zero.  What am I doing wrong?  Thanks in advance.

addprocs(4);

@everywhere function test(state)
  return state.^2.0
end

const n = 10000;
const m = 10000;
states = randn(n);
store = zeros(n,m);
for i = 1:n j = 1:m
  state = states[i]
  store[i,j] = i-j+test(state)
end

stored = SharedArray(typeof(1.0),n,m);
@parallel for i = 1:n j = 1:m
  state = states[i]
  stored[i,j] = i-j+test(state)
end

println(maximum(store-stored))
println(maximum(store-stored))

rmprocs(2:5);

Reply via email to