franktakes / teexgraph

C++ library for large-scale network analysis and computation
GNU General Public License v3.0
24 stars 8 forks source link

Average distance error #14

Closed franktakes closed 2 years ago

franktakes commented 2 years ago

Currently, the averageDistance() function in Graph.cpp appears broken; seemingly due to something with the OpenMP. Until it is fixed, the average distance value can easily be derived from the summary statistics of the distanceDistribution() function in examples.cpp.

r-barnes commented 2 years ago

You should write your OpenMP as:

#pragma omp ... default(none) shared(xxx) private(xxx) firstprivate(xxx)

The default(none) forces all variables to be marked explicitly as shared, private, firstprivate, &c, this helps prevent situations in which a variable is being unexpectedly shared.