[Omp] Barrier constructs and regions
Michael Suess
mike_ml at suessnetz.de
Thu Jun 16 00:50:41 PDT 2005
On Wednesday 15 June 2005 16:44, Shah, Sanjiv wrote:
> This is a con-forming program that probably works with most
> implementations, although it's possible some flag an error (like maybe
> ours, I don't remember).
>
> The resons are as you quoted:
>
> "The following restrictions apply to the barrier construct:
> - Each barrier region must be encountered by all threads in a team or by
> none
> at all
> - The sequence of work-sharing regions and barrier regions encountered
> must be
> the same for every thread in a team."
Hi Sanjiv,
if I understand your answer correctly, this also means that many constructs
can give rise to the same region? Which is something that should definitely be
clarified in the spec, since this would have never occurred to me. On the
other hand, if this were not so, barriers could never be used when manually
dividing work in between threads (with omp_get_thread_num() as shown), so it
kind of makes sense. But then, compilers should not warn about it either :-).
Best regards, Michael
More information about the Omp
mailing list