1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- #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;
- }
|