[Omp] atomic directive semantics

Richard Henderson rth at twiddle.net
Thu Sep 22 15:51:07 PDT 2005


On Thu, Sep 22, 2005 at 03:06:14PM -0700, Shah, Sanjiv wrote:
> The OpenMP specifications have been written in a way that allows an
> implementation the freedom to degrade a proper set of atomics to
> critical sections based on the HW and SW support available.

Hmm.  But since readers don't use #pragma omp atomic, critical
sections for writers only are by themselves are not sufficient.
The platform must have an atomic store instruction for the data
type; otherwise a reader can read a partial update.

So while this is certainly possible for long double on i386,
but not powerpc.  And it isn't possible for complex long double
on any platform.

> Our intention was integer and real, and perhaps complex.  Pointer can
> also be done easily.  It's really up to each implementation.
> 
> I hope that answers your question.

Not really.  If it's up the the implementation, then the specification
should use fuzzier language.  If it isn't, then a little clarification
would be nice.

While I was pondering the problem, I downloaded the Intel compiler,
and see that it simply punts and doesn't allow complex data types.
So perhaps that's good enough -- there isn't a code base that relies
on such things working.


r~




More information about the Omp mailing list