00001 #include <omp.h> 00002 #include <stdlib.h> 00003 00004 int 00005 main (void) 00006 { 00007 int i = -1, j = -1; 00008 00009 omp_set_nested (0); 00010 omp_set_dynamic (0); 00011 #pragma omp parallel num_threads (4) 00012 { 00013 #pragma omp single 00014 { 00015 i = omp_get_thread_num () + omp_get_num_threads () * 256; 00016 #pragma omp parallel num_threads (2) 00017 { 00018 #pragma omp single 00019 { 00020 j = omp_get_thread_num () + omp_get_num_threads () * 256; 00021 } 00022 } 00023 } 00024 } 00025 if (i < 4 * 256 || i >= 4 * 256 + 4) 00026 abort (); 00027 if (j != 256 + 0) 00028 abort (); 00029 return 0; 00030 }