next up previous contents
Next: 7 The ADAPTOR OpenMP Up: ADAPTOR OpenMP Programmers Guide Previous: 5 Private and Shared   Contents

6 Work Sharing

So far, the code within a parallel region is executed by all the threads of the team. Nevertheless, each thread might execute parts of the computations.

      do I = 1, N
         A(I) = ...
      end do

!$omp parallel private (INODE, NNODE, LB, UB)
      NNODE = omp_get_num_threads ()
      INODE = omp_get_thread_num()
      LB  = I * (N / NNODE) + 1
      UB  = INODE * (N / NNODE)
      do LB = UB
         A(I) = ..
      end do
!$omp end parallel

!$omp do
      do I = 1, N
         A(I) = ...
      end do

New Clauses first met in work-sharing directives are:


next up previous contents
Next: 7 The ADAPTOR OpenMP Up: ADAPTOR OpenMP Programmers Guide Previous: 5 Private and Shared   Contents
Thomas Brandes 2004-03-18