Commit ace9d758 authored by Tiago Peixoto's avatar Tiago Peixoto

Fix OpenMP reduction problem

parent 3ba46e75
......@@ -112,7 +112,7 @@ struct get_global_clustering
c_err = 0.0;
#pragma omp parallel for default(shared) private(i,temp) \
schedule(dynamic) reduction(+|c_err)
schedule(dynamic)
for (i = 0; i < N; ++i)
{
typename graph_traits<Graph>::vertex_descriptor v = vertex(i, g);
......@@ -122,6 +122,7 @@ struct get_global_clustering
temp = get_triangles(v, g);
double cl = double(triangles - temp.first)/(n - temp.second);
#pragma omp atomic
c_err += (c - cl)*(c - cl);
}
c_err = sqrt(c_err);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment