Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Ordered sections (Section 2.6.6 on page 22) are useful for sequentially ordering the output from work that is done in parallel. The following program prints out the indexes in sequential order:
#pragma omp for ordered schedule(dynamic)
for (i=lb; i<ub; i+=st)
work(i);
void work(int k)
{
#pragma omp ordered
printf_s(" %d", k);
}