To: J3 J3/13-355 From: Bill Long, Malcolm Cohen Subject: Memory model for atomics Date: 2013 October 15 References: N1983, N1989 Discussion ---------- {Reinhold C}: Request to specify a memory model for atomic functions (beyond the current model). Possible side effects for EVENT statements. Response: Defer to {Nick 22}. {Malcolm Reason 2}: An explicit memory model for atomics [beyond what is currently in F2008] is needed for both users and vendors. Response: Defer to {Nick 22}. {Nick 22}: 7.2 p15:13-15. This specification will cause massive confusion, and it was clear from WG5 in Delft that there was no agreement on even the minimal semantics specified by Fortran. In particular, several people were assuming levels of consistency that are not always available in existing hardware, and would need extra work in the compiler to provide. At the very least, there needs to be a Note saying clearly and explicitly that currently their behavior is deliberately left entirely processor-dependent, and WG5 intends to provide a proper semantic specification in due course. Response. Users of existing implementations have been using remote atomic memory operations as part of the SHMEM library, UPC, and Fortran with coarrays for over a decade on several hardware architectures with significant success. MPI includes functions to implement these operations, so there is an option available. In the worst case, atomic operations can always be implemented using a global lock that is acquired each time an operation is done. However, this implementation would be undesirable for performance reasons. Edits are provided to set memory consistency expectations for atomic operations in Fortran. Edits to N1983 --------------