Unexpectedly good performance with openmp parallel for loop
问题 I have edited my question after previous comments (especially @Zboson) for better readability I have always acted on, and observed, the conventional wisdom that the number of openmp threads should roughly match the number of hyper-threads on a machine for optimal performance. However, I am observing odd behaviour on my new laptop with Intel Core i7 4960HQ, 4 cores - 8 threads. (See Intel docs here) Here is my test code: #include <math.h> #include <stdlib.h> #include <stdio.h> #include <omp.h>