Combined parallel work-sharing

  • PARALLEL DO / END PARALLEL DO
    • Convenient combination of PARALLEL and DO for a parallel region that contains a single DO directive
    • Semantics identical to explicitly specifying PARALLEL followed immediately by DO
    • Accepts any of the clauses for PARALLEL or DO directive
    • If used, the END PARALLEL DO must appear immediately after the loop
    • Available on the IBM SP
    • On the IBM SP, END PARALLEL DO is implicitly assumed as the end of loop, specifying END PARALLEL DO gives an error

      !$OMP PARALLEL [clause[[,]clause]...]
           do_loop
      [!$OMP END PARALLEL DO]

  • PARALLEL SECTIONS / END PARALLEL SECTIONS
    • Convenient combination of PARALLEL and SECTIONS for a parallel region that contains a single SECTIONS directive
    • Semantics identical to explicitly specifying PARALLEL followed immediately by SECTIONS
    • Accepts any of the clauses for PARALLEL or SECTIONS directive
    • Available on the IBM SP
           $!OMP PARALLEL SECTIONS [clause[[,]clause]...]
                [!$OMP SECTION]
                     block
                [!$OMP SECTION
                     block]
                ....
           !$OMP END PARALLEL SECTIONS