- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The ATOMIC_CAS is documented as having the atom as a scalar coarray or coindexed object and of type integer with kind ATOMIC_INT_KIND or type logical with kind ATOMIC_LOGICAL_KIND.
However, this would preclude the use of this in an OpenMP multi-threaded environment (variables located in same process, but accessed by multiple threads).
So the questions are:
1) Can the ATOMIC_CAS be used without MPI (iow within a single image)?
2) When doing so, is the code smart enough to recognize this and avoid MPI overhead?
3) Or should I impliment my own CAS in C using <stdatomic.h>?
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Confirmed. We always use MPI, and no special logic to skip the MPI calls.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am checking with 2 of the developers. 99% sure I know the answer but waiting for confirmation. I think the answer is you will have to create your own CAS in C. but let's let the actual code owner for our CAF implementation answer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Confirmed. We always use MPI, and no special logic to skip the MPI calls.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for looking into this.
I will call C functions.
FWIW
In my use requirements, the OpenMP reduction clause is not appropriate. I have a large array where a few cells may be updated by different threads. Thus, a reduction on the whole array is not optimal. A CAS would be better.
Old = Array(i) ! any type
New = Old + Change
! CAS is an interface of various types
! that uses the address and widths of the variables
do while(.not.CAS(Array(i), Old, New))
Old = Array(i)
New = Old + Change
end do
Jim Dempsey

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page