-static void compute_load_imbalance()
-{
- unsigned n = loads.size();
- load_avg = std::accumulate(loads.begin(), loads.end(), 0.0) / n;
- double variance = 0.0;
- double epsilon = 0.0;
- for (unsigned i = 0 ; i < n ; ++i) {
- double diff = loads[i] - load_avg;
- variance += diff * diff;
- epsilon += diff;
- }
- variance = (variance - (epsilon * epsilon) / n) / n;
- load_stddev = sqrt(variance);
-}
+#define PR_STATS(descr, st) \
+ INFO5("| %.*s: %g / %g / %g", 39, \
+ descr " total/avg./stddev. at exit.........................", \
+ st.get_sum(), st.get_avg(), st.get_stddev())