From 1c5db4493775822a35aa8cd442e9a633de0b5100 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Wed, 26 Oct 2016 16:07:33 +1300 Subject: Calculate efficiency from physical thread count, not worker thread count --- fractal-gen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fractal-gen.c b/fractal-gen.c index 59329aa..3dbf505 100644 --- a/fractal-gen.c +++ b/fractal-gen.c @@ -202,12 +202,12 @@ main(int argc, char **argv) for (i = 0; i < threads; i++) { data_section *s = &(sections[i]); - time_ch += (timespec_diff(s->time_start, s->time_end)) / threads; + time_ch += (timespec_diff(s->time_start, s->time_end)) / sysconf(_SC_NPROCESSORS_ONLN); } fprintf(stderr, "Wall-clock time: %.2f seconds\n" - "Average worker time: %.2f seconds\n" + "Average time per CPU thread: %.2f seconds\n" "Multi-core efficiency: %.2f%%\n" , time_wall, time_ch, 100*(time_ch)/time_wall); -- cgit v1.1