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