00001
00002
00003
00004 extern void abort (void);
00005 extern void omp_set_dynamic (int);
00006
00007 int
00008 main (void)
00009 {
00010 int i, j;
00011 omp_set_dynamic (0);
00012 #pragma omp parallel for lastprivate (i, j) num_threads (8) schedule (static)
00013 for (i = 0; i < 5; i++)
00014 j = i;
00015 if (i != 5 || j != 4)
00016 abort ();
00017 #pragma omp parallel for lastprivate (i, j) num_threads (8) schedule (static, 2)
00018 for (i = 0; i < 5; i++)
00019 j = i;
00020 if (i != 5 || j != 4)
00021 abort ();
00022 #pragma omp parallel for lastprivate (i, j) num_threads (8) schedule (dynamic)
00023 for (i = 0; i < 5; i++)
00024 j = i;
00025 if (i != 5 || j != 4)
00026 abort ();
00027 #pragma omp parallel for lastprivate (i, j) num_threads (8) schedule (static)
00028 for (i = -12; i < 21; i += 3)
00029 j = i;
00030 if (i != 21 || j != 18)
00031 abort ();
00032 #pragma omp parallel for lastprivate (i, j) num_threads (8) schedule (static, 2)
00033 for (i = -12; i < 21; i += 3)
00034 j = i;
00035 if (i != 21 || j != 18)
00036 abort ();
00037 #pragma omp parallel for lastprivate (i, j) num_threads (8) schedule (dynamic, 3)
00038 for (i = -12; i < 21; i += 3)
00039 j = i;
00040 if (i != 21 || j != 18)
00041 abort ();
00042 return 0;
00043 }