[Omp] OpenMP spec 2.5 seems to have incorrect flush example on page 12
Greg Bronevetsky
greg at bronevetsky.com
Mon May 7 15:34:54 PDT 2007
> So, gcc generates code to hold temporary views of shared variables
> across locks and barriers, too? Then this is certainly a problem.
>
I don't know, but Marcel's whole issue was that he wanted to have full
freedom to optimize code between flushes. I'm assuming that he wanted to
do the same between explicit constructs, especially since most OpenMP code
sits between synchronization constructs of one kind or another.
> But there are two problems that have been illuminated by this
> discussion: 1) compilers optimizing too agressively and 2) users not
> using flushes correctly.
>
> Marcel is obviously a smart guy, and a bunch of OpenMP gurus chimed in
> on the discussion, all (apparently) without noticing that the original
> code did not use flushes properly. Whether the lack of proper flushes
> is the cause of the optimization failure or not, I'm simply saying that
> we need to address this lack of understanding by improving the spec.
>
> And my suggestion is to warn people of the complexity, add some more
> commentary, and possibly add a section addressing code optimization.
>
You're right about that. I for one just assumed that Marcel's example
was the simplified version and the full version did have flushes. Anyhow,
it would be nice to just sprinkle throughout the spec various warnings and
admonitions against using flushes.
Greg Bronevetsky
More information about the Omp
mailing list