I am learning OpenMP concurrency and have tried myself in my existing code. In this code, I tried to make all loops for parallel. However, this seems to make the MUCH program slower, at least 10 times slower, or even more than the single-threaded version.
Here is the code: http://pastebin.com/zyLzuWU2
I also used pthreads, which turned out to be faster than the single-threaded version.
Now the question is: what am I doing wrong in my OpenMP implementation that causes this slowdown?
Thanks!
edit: single-threaded version - it's just without all #pragmas
source share