How does the SECTIONS directive in OpenMP distribute work?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In OpenMP when using omp sections , will the threads be distributed to the blocks inside the sections , or will each thread be assigned to each sections? When nthreads == 3 : #pragma omp sections { #pragma omp section { printf ("id = %d, \n", omp_get_thread_num()); } #pragma omp section { printf ("id = %d, \n", omp_get_thread_num()); } } Output: id=1 id=1 But when I execute the following code: #pragma omp sections { #pragma omp section { printf ("id = %d, \n", omp_get_thread_num()); } #pragma omp section { printf ("id = %d, \n", omp_get