c - Why is my OpenMP implementation slower than a single threaded implementation? -


i learning openmp concurrency, , tried hand @ existing code have. in code, tried make loops parallel. however, seems make program slower, @ least 10x slower, or more single threaded version.

here code: http://pastebin.com/zylzuwu2

i used pthreads, turns out faster single threaded version.

now question is, doing wrong in openmp implementation causing slowdown?

thanks!

edit: single threaded version 1 without #pragmas

one problem see code using openmp across loops small (8 or 64 iterations, example). not efficient due overheads. if want use openmp n-queens problem, @ openmp 3.0 tasks , thread parallelism branch-and-bound problems.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -