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
Post a Comment