Multi-core example with OpenMP slower than single core?

Tony_the_D
Total Points:
50
Registered User
October 13, 2008 2:00 PM PDT
Rate
 
#3 Reply to #1
There is a lot of overhead in OpenMP.  It will run slower unless the loop takes a significant fraction of a second single-threaded.  Tens of milliseconds, minimum.
Also, if the task if memory bandwidth bound rather than compute or cache bound, it will run no faster parallelized, regardless of the API used.  At least on most single-socket hardware.  You have to know your system architecture here.

 

Thanks for the feedback.  Your comments provide me something to work on.  I can easily construct a test case where I gradually increase the time of the inner loops so that I can evaluate the effect of the overhead.  Knowing about the overhead will also provide a better base for evaluating other parts of our software which could be parallelized.



Intel Software Network Forums Statistics

8292 users have contributed to 31239 threads and 99116 posts to date.
In the past 24 hours, we have 10 new thread(s) 14 new posts(s), and 23 new user(s).

In the past 3 days, the most popular thread for everyone has been comparison cilk++, openmp, pthreads first results The most posts were made to Pipeline buffer between stages? The post with the most views is Very amusing...  Escalated as

Please welcome our newest member amirsam7