OpenMp里设为firstPrivate的指针数组无法私有,仍是共享的,怎么回事呢?
以下是代码片段
bool **comMatrix;
int stemCount;
#pragma omp parallel num_threads(2) firstprivate(comMatrix,stemCount)
{
initInd(comMatrix,stemCount);
}
查看comMatrix的地址发现,两个线程中这个变量的地址是一样的,说明没有生成私有的comMatrix,
而stemCount的地址就不一样,说明每个线程各自生成了一个stemCountPa的副本。难道指针数据无法私有吗?请教各位!