Solved by tom in post #5 
              
              
                To expand a bit on Alex answer: 

In general, what you compute by atomicAdd is an “index add”, a sequential version would look like  for i in range(...):
      foo[key[i]] += value[i]

The non-determinism comes from the fact that the order in which the additions are computed in the atomicAdd is non-…