Export (0) Print
Expand All
1 out of 3 rated this helpful - Rate this topic

A.4 Using the nowait Clause

If there are multiple independent loops within a parallel region, you can use the nowait clause (Section 2.4.1 on page 11) to avoid the implied barrier at the end of the for directive, as follows:

#pragma omp parallel
{
    #pragma omp for nowait
        for (i=1; i<n; i++)
             b[i] = (a[i] + a[i-1]) / 2.0;
    #pragma omp for nowait
        for (i=0; i<m; i++)
            y[i] = sqrt(z[i]);
}
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.