What am I doing wrong in the following code? function foo(N; parallel=false) if parallel && nprocs() < CPU_CORES addprocs(CPU_CORES - nprocs()) end
result = SharedArray(Float64, 9, N) @parallel for i=1:N sleep(1) result[:,i] = rand(3,3)[:] end result end If I call foo(60, parallel=true), result is all zeros. Expected behavior is a random matrix. -Júlio