!$OMP SECTIONS

!$OMP SECTIONS

The OpenMP portion of the IVF manual has:

SECTIONS directives must be encountered by all threads in a team or by none at all. It must also be encountered in the same order by all threads in a team.

Just how does one control the ordering of the threads (re: same order by all threads)? Is this a misprint?

Jim

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi Jim,

The OpenMP 2.5 specification doesn't say anything about an order dependence on the sections directive. This looks like a documentation error. I'll report it to the IVF team.

Henry

Jim -

I don't think this has to do with the threads or their order of execution.

This sounds like it is disallowing jumps into and out of the SECTIONS code ornesting some SECTIONS within a conditional. Thus, the following code is not legal:

Code:

!$OMP SECTIONS
!$OMP SECTION
    some stuff
    IF (some_condition) THEN
!$OMP SECTIONS
!$OMP SECTION
       conditional_stuff
!$OMP SECTION
       other_conditional_stuff
!OMP END SECTIONS
    ENDIF

!$OMP SECTION
    other_some_stuff_without_if
!$OMP END SECTIONS

In this example, not all threads would encounter the nested SECTIONS which violates the requirement inthe first sentence. (After writing this code, I realize that the nesting in superflous if the conditional was in a parallel region and if some threads would evaluate .TRUE. while others evalaute .FALSE. Nested SECTIONS, without a conditional, would also violate the requirements.)

As for encounter order, this just means that the same set of SECTIONS must be executed by each thread. I suppose this could be violated by some conditional code or selection logic.

--clay

Leave a Comment

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