Sure, no problem.
I am not forcing any number of threads, but omp_get_num_threads() returns 8. On Ubuntu in Parallels it returns 4 (because it only has access to 4 cores through the settings).
I have a Intel(R) Core(TM) i7-3720QM CPU @ 2.60GHz (4 cores, running up to 8 threads).
I will try to post a minimum example of my assignment, the execution times are very consistent and I am using gettimeofday to measure time.
Here is the code :http://codepad.org/pqs9uz72
On OSX I get the following result :
Where the first one is the serial execution and the second is the omp version.
On Ubuntu in Parallels I get :
Interestingly if I enable the pragma on line 99, both OS's get a nice speedup. On OSX the time then becomes:
And on Ubuntu the time becomes:
Which is basically the same. I don't quite understand why this is? I am supposed to run the algorithm a number of times, but not in parallel, to calculate the time it takes. I can understand that there is perhaps a speedup from 0.44 to 0.17 since it might start a new execution of the algorithm before the previous one is done and therefore 'cheat' a little, but a speedup of 40.81 seconds to 0.15 seconds? Where does that come from?