openmpパラレルコードで変数を共有変数として渡したいのですが、構造化変数を共有変数に渡すためにどうすればよいかわかりません。ここに私のコードは次のとおりです。 私はわからない、これはこれかないための正しい方法である場合:共有または非公開のopenmpコードの構造型変数
struct lvl{
int *L;
int *list;
};
struct lvl* lvls(int s,int k){
struct lvl* lvls =malloc(sizeof (struct lvl));
lvls->L = (int*)calloc(s+1, sizeof(int));
lvls->list=(int*)calloc(k+1,sizeof(int));
return lvls;
}
int main(int argc, char *argv[])
{
int n=100;
int k=200;
struct lvls *lvl = lvls(n,K);
#pragma omp parallel num_threads(threadnum) private(k,bi,b,kstart,kend,v,bmax,max,bwt) firstprivate(BinAff,Blist) shared(capacity,lvl)
{
#pragma omp for schedule (static,100)
for (u=0;u<G->n;u++){
//some code in here
}
}
}
共有場合、私は知りたいと思ったん(LVL)は、構造体の両方の配列を作るための正しい方法があるが、 (Lとリスト)共有配列?もし私が何をすればいいのですか?私はshared (lvl->L,lvl->list)
してみましたが、コンパイルエラーが発生します。