1
我有封闭在一个部分一个块阻止这样为什么OpenMP的给予警告,当单块被封闭在部分块
#include <stdio.h>
#include <stdlib.h>
#include <omp.h>
int main (int argc, char *argv[])
{
int nthreads, tid;
/* Fork a team of threads giving them their own copies of variables */
#pragma omp parallel private(tid)
{
#pragma omp sections
{
#pragma omp section
{
printf("First section %d \n" , tid);
}
#pragma omp section
{
#pragma omp single
{
printf("Second Section block %d \n" , tid);
}
}
}
} /* All threads join master thread and disband */
printf("Outside parallel block \n");
}
当我编译这个代码的编译器会发出如下警告
工作共享区域可能没有紧密嵌套在工作共享区域,关键区域,有序区域或主区域内
为什么会这样?