-
Notifications
You must be signed in to change notification settings - Fork 61
Description
Through developing #179, I found that changing the coordinate space could break bit-reproducibility for some tests that use threading. Although this was eventually fixed in the development of #179, it made me aware that several kernels are not safe for threading.
These kernels all WRITE to W2 fields, but include a check along the lines of:
! only do calculation if not already done
if (du_inc(map_w2(df)) == 0) then
... <do calculation>
end if
This is to prevent both columns trying to write to the same face (and is an optimisation in that it reduces duplication of computations). This is not safe for threading because there is no guarantee which thread will column will write to the face first. We seem to get away with this at the moment because our current tests ensure that both columns perform the same calculation to the bit level.
The solution is to use the face_selector objects to ensure that each face is only written to by a specified column.