Do any of your calculations depend on the values of A? If so they will get different values depending in what order A[i] is updated. And the order depends on scheduling of the processes, which is not deterministic.
Cheers Lex On Friday, November 27, 2015 at 8:44:42 AM UTC+10, Eduardo Lenz wrote: > > Thanks Seth. > > I have a LOT of floating point calculations inside this loop. So, there > should be it ! > > Now I have to figure it out how to overcome it....if it is even possible > :0) > > Thanks a lot !! > > On Thursday, November 26, 2015 at 5:59:56 PM UTC-2, Seth wrote: >> >> Are you doing floating point calculations? Some FP operations aren't >> associative and therefore may appear different on successive runs of a >> parallel operation depending on what's summed first: >> >> julia> (0.1 + 0.2) + 0.3 >> 0.6000000000000001 >> >> >> julia> 0.1 + (0.2 + 0.3) >> 0.6 >> >> >> On Thursday, November 26, 2015 at 11:48:25 AM UTC-8, Eduardo Lenz wrote: >>> >>> Hi. >>> >>> I came across a very weird behaviour when using a very simple @parallel >>> loop. The block is quite large and complex, but the idea is the following: >>> >>> >>> A = zeros(some_dimension) >>> A = convert(SharedArray,A) >>> @sync @parallel for i=1:some_dimension >>> >>> Lots of code, but with no function calls >>> >>> A[i] += block_result >>> >>> end >>> >>> some computation with sdata(A). >>> >>> If I use 4 processes, I get one result. With 8 processes, a diferent >>> result. Without parallel processing, another one. >>> >>> I am probably losing something, but I think this is not the intended >>> behaviour. >>> >>> I am using jula 4.11, fedora 23 - 64 bits. >>> >>> Thanks for your help. >>> >>
