add omp critical, corrected openmp
This commit is contained in:
@@ -248,11 +248,14 @@ void CalcCn_pp(DATA *data, HEAD *head, TYPE *type, DATASET *cn,
|
|||||||
if (cn->xmin < d && d < cn->xmax){
|
if (cn->xmin < d && d < cn->xmax){
|
||||||
p = (int)floor((d - cn->xmin)/cn->dx);
|
p = (int)floor((d - cn->xmin)/cn->dx);
|
||||||
k = type->pairid[data[i].type_new][data[j].type_new];
|
k = type->pairid[data[i].type_new][data[j].type_new];
|
||||||
|
#pragma omp critical
|
||||||
|
{
|
||||||
cn_[p][k] = cn_[p][k] + 1.0;
|
cn_[p][k] = cn_[p][k] + 1.0;
|
||||||
cn_[p][cn->m-1] = cn_[p][cn->m-1] + 1.0;
|
cn_[p][cn->m-1] = cn_[p][cn->m-1] + 1.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
CalcGr(data, head, type, cn, gr, cn_, gr_);
|
CalcGr(data, head, type, cn, gr, cn_, gr_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user