hi.
Is there an easy way to implement atomic integer operations (one sided) in mpi? last time I looked three years ago, example in mpi book was fairly complex to implement.
Thanks
hi.
Is there an easy way to implement atomic integer operations (one sided) in mpi? last time I looked three years ago, example in mpi book was fairly complex to implement.
Thanks
I don't think so. One part of the problem is that most platforms (combination of hardware, o/s, libraries, etc) don't provide guarantees of atomicity for integer operations when concurrent processes are running it's generally left to the programmer to impose such behaviour when required. And MPI seems to operate in the same way.
There is no way to implement a general case "atomic" one-sided read/modify/write operation using MPI.
For operations between nodes, there is no way using common interconnects to get anywhere near an "atomic" operation. The TCP/IP layer can not do any atomic operations. An IBV fabric involves layers of libraries and a kernel module to a local HCA, some path through one or more switches, another HCA with a kernel module and more layers of libraries on the other side.
For operations between ranks on the same node, if you need a guarantee of "atomic" for single integer operations, then shared memory is the appropriate tool to use, MPI is not.