Parallel Programming in OpenMP

3.8: Exercises

3.8 Exercises

  1. Explain why each of the following loops can or cannot be parallelized with a parallel do (or parallel for) directive.

    1.           do i = 1, N              if (x(i) .gt. maxval) goto 100          enddo    100 continue
    2.           x(N/2:N) = a * y(N/2:N) + z(N/2:N)
    3.           do i = 1, N              do j = 1, size(i)                   a(j, i) = a(j, i) + a(j + 1, i)<a name="222"></a><a name="page91"></a>              enddo          enddo
    4.           for (i = 0; i < N; i++) {              if (weight[i] > HEAVY) {                  pid = fork();                ...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Waveplates and Retardation Plates
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.