12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- #include <stdlib.h>
- int cnt;
- void
- check (int x)
- {
- if (cnt++ != x)
- abort ();
- }
- int
- main (void)
- {
- int j;
- cnt = 0;
- #pragma omp parallel for ordered schedule (static, 1) num_threads (4) if (0)
- for (j = 0; j < 1000; j++)
- {
- #pragma omp ordered
- check (j);
- }
- cnt = 0;
- #pragma omp parallel for ordered schedule (static, 1) num_threads (4) if (1)
- for (j = 0; j < 1000; j++)
- {
- #pragma omp ordered
- check (j);
- }
- cnt = 0;
- #pragma omp parallel for ordered schedule (runtime) num_threads (4) if (0)
- for (j = 0; j < 1000; j++)
- {
- #pragma omp ordered
- check (j);
- }
- cnt = 0;
- #pragma omp parallel for ordered schedule (runtime) num_threads (4) if (1)
- for (j = 0; j < 1000; j++)
- {
- #pragma omp ordered
- check (j);
- }
- cnt = 0;
- #pragma omp parallel for ordered schedule (dynamic) num_threads (4) if (0)
- for (j = 0; j < 1000; j++)
- {
- #pragma omp ordered
- check (j);
- }
- cnt = 0;
- #pragma omp parallel for ordered schedule (dynamic) num_threads (4) if (1)
- for (j = 0; j < 1000; j++)
- {
- #pragma omp ordered
- check (j);
- }
- cnt = 0;
- #pragma omp parallel for ordered schedule (guided) num_threads (4) if (0)
- for (j = 0; j < 1000; j++)
- {
- #pragma omp ordered
- check (j);
- }
- cnt = 0;
- #pragma omp parallel for ordered schedule (guided) num_threads (4) if (1)
- for (j = 0; j < 1000; j++)
- {
- #pragma omp ordered
- check (j);
- }
- return 0;
- }
|