[Omp] atomic directive semantics

Dieter an Mey anmey at rz.rwth-aachen.de
Fri Sep 23 00:56:45 PDT 2005


Why can't we just go abandon atomic and let the compiler try to optimize 
the critical region?

Dieter


Richard Henderson wrote:

> 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~
> 
> _______________________________________________
> Omp mailing list
> Omp at openmp.org
> http://openmp.org/mailman/listinfo/omp_openmp.org
> 


-- 
--------------------------------------------------------------------
Dieter an Mey
High Performance Computing               Hochleistungsrechnen
RWTH Aachen University                   Rechen- und Kommunikations-
Center for Computing and Communication   zentrum der RWTH Aachen
phone: ++49-(0)241-80-24377              Seffenter Weg 23
fax:   ++49-(0)241-80-22134              52074 Aachen, Germany
email: anmey at rz.rwth-aachen.de
--------------------------------------------------------------------





More information about the Omp mailing list