OpenMp里设为firstPrivate的指针数组如何生成各个线程的副本??
以下是代码片段
bool **comMatrix; int stemCount;
#pragma omp parallel num_threads(2) firstprivate(comMatrix,stemCount)
{
initInd(comMatrix,stemCount);
}
查看comMatrix的地址发现两个线程中这个变量的地址是一样的,前面发帖问过,是因为指针做参数传递,本来就是传地址,现在的问题是这样的:要在两个线程中生成不同的comMatrix的副本,怎么办呢?