Hello, I did few more experiments. Built-in atomics are disabled by default and can be enabled by "--enable-builtin-atomics". With this option, a different atomic file is include (I mean, different from the other three mentioned in the earlier email).
opal/include/opal/sys/sync_builtin/atomic.h By enabling "--enable-builtin-atomics", the OpenMPI library will not only get the latest optimizations from GCC __sync functions, but also get all additional functions, such as <__sync_or_and_fetch> <__sync_and_and_fetch> etc. Also, this way, the arch/*.asm files need not be maintained. Seems there is more of an advantage to have "--enable-builtin-atomics". Am I missing something ? Please let me know your thoughts. Thanks, - Sreenidhi. On Wed, Mar 30, 2016 at 10:33 AM, Sreenidhi Bharathkar Ramesh < sreenidhi-bharathkar.ram...@broadcom.com> wrote: > Hello, > > With respect to atomic operations in assembly, I can see three source > files, for the same AMD64 architecture. > > 1. opal/asm/base/AMD64.asm > 2. opal/include/opal/sys/amd64/atomic.h > 3. opal/include/opal/sys/atomic_impl.h > > What is the need for three files ? How are they inter-related ? > > Please let me know. > > Thanks, > - Sreenidhi. >