I'm trying to parallelize qsort() function in c++ with openMP, but I have some problems. For of all, for a high number of element to sort (ex: V=1000) qsort doesn't work at all, I never exit this function (infinite loop). Then, I notice that my parallel version of qsort is much slower then the serial one. Anyone could help me? Here the code: https://dpaste.de/EaH0.
here the average of time elapsed where kruscalP is the parallel version:
thanks
A[i] = A[i+1]. You need to change your algorithm or put your swap in a critical section.