diff options
author | David Phillips <david@sighup.nz> | 2016-10-26 16:07:33 +1300 |
---|---|---|
committer | David Phillips <david@sighup.nz> | 2016-10-26 16:07:33 +1300 |
commit | 1c5db4493775822a35aa8cd442e9a633de0b5100 (patch) | |
tree | a3bd23255d9e97acf7ee94ea1de8a8e048783198 | |
parent | 253ecc8d4f6aaaa4a7f86f713d1c485dac8eda78 (diff) | |
download | fractal-gen-1c5db4493775822a35aa8cd442e9a633de0b5100.tar.xz |
Calculate efficiency from physical thread count, not worker thread count
-rw-r--r-- | fractal-gen.c | 4 |
1 files 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); |