OpenMP atomic capture arguably broken

OpenMP atomic capture arguably broken

Yes, I know the OpenMP 3 standard does not specify what, if anything, atomic does and OpenMP 4 says to follow C++ (which is almost equally ambiguous), but the Intel compilers seem to take the sensible line of delivering sequential consistency for explicit atomic sections.  The following program shows a case where that fails.  Look at lines 244-246 in the output, which are:

Validating capture in OpenMP using volatile and y = x; x += v with atomic
There were at least 749115 breaches of sequential consistency (NOT expected)

It should be easy enough to find the code that causes the problem - sorry about not stripping down, but I am tied up with other work!

Downloadapplication/x-gtar bug-2.tgz154.75 KB
4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hello, is this for C++ Compiler 14.0 Beta?

Yes.  And 13...183.  Sorry for not saying.

confirming a bug. 

thanks for a reproducer. it was sent to appropriate people.

Leave a Comment

Please sign in to add a comment. Not a member? Join today