3 ms·
Good catch acqq! I wrote the code for that essay first, copied it in my working algorithm (which is a bit more complicated than what wrote here), and after a fe
by dalke 15y ago
Good catch acqq! I wrote the code for that essay first, copied it in my working algorithm (which is a bit more complicated than what wrote here), and after a few segfaults and other problems, got it working there by just using the max thread count. However, that fix didn't make it back to the essay.
I've updated the essay code, with commentary about the problem. Thank you for pointing it out.
I've updated the test so it says "starting N=110885 different jobs for the worker threads".
Also, I never reported the speedup of one core vs. four cores. What I reported was the speedup from computing across the NxN matrix vs. using symmetry and only computing the N*(N-1)/2 similarities. That's the factor of two time.
Raw data computed yesterday, for a threshold of 0.80 (and a slightly different problem), on an 8 core machine, using from 1 to 8 cores, is:
OpenMP pthreads
cores time scaleup time scaleup
1 0:02:00 1.0 0:02:01 0.99
2 0:01:06 1.8 0:01:06 1.8
3 0:00:44 2.7 0:00:44 2.7
4 0:00:32 3.75 0:00:33 3.6
5 0:00:27 4.4 0:00:28 4.3
6 0:00:23 5.2 0:00:23 5.2
7 0:00:20 6.0 0:00:20 6.0
8 0:00:26 4.6 0:00:19 6.3
This is a rented Amazon node, and I consistently found that 8 nodes using OpenMP gave poor results, so I suspect I didn't have access to 8 cores.
This benchmark also doesn't have the randomization which confused my previous benchmark run, so you can see that the two threading systems gave essentially identical timings. Looks like I'll need to update a previous essay.