4 extern int omp_set_dynamic (int);
5 extern int omp_get_thread_num (void);
6 extern void abort (void);
8 int a
= 8, b
= 12, c
= 16, d
= 20, j
= 0, l
= 0;
9 char e
[10] = "a", f
[10] = "b", g
[10] = "c", h
[10] = "d";
18 #pragma omp parallel num_threads (2) reduction (+:l)
19 if (k
== omp_get_thread_num ())
21 #pragma omp parallel for shared (a, e) firstprivate (b, f) \
22 lastprivate (c, g) private (d, h) \
23 schedule (static, 1) num_threads (4) \
25 for (i
= 0; i
< 4; i
++)
27 if (a
!= 8 || b
!= 12 || e
[0] != 'a' || f
[0] != 'b')
41 if (a
!= 8 + 6 || b
!= 12 + i
|| c
!= i
|| d
!= i
)
43 if (e
[0] != 'a' + 6 || f
[0] != 'b' + i
|| g
[0] != 'g' + i
)
48 if (j
|| a
!= 8 + 6 || b
!= 12 || c
!= 3 || d
!= 20)
50 if (e
[0] != 'a' + 6 || f
[0] != 'b' || g
[0] != 'g' + 3 || h
[0] != 'd')