Hello,
Description:
Parallel Sort Library that supports Parallel Quicksort, Parallel HeapSort and Parallel MergeSort on Multicores systems.
Parallel Sort Library 2.0 uses my Thread Pool Engine and quicksort many array parts - of your array - in parallel using Quicksort or HeapSort or MergeSort and after that it finally merge them - with the merge() procedure -
And as you know , Quicksort is a divide and conquer algorithm that have the following best case performance:
T(n) = T(n/2) + T(n/2) + O(n)
= 2T(n/2) + (n)
And from case 2 of Master theorem, the recurrence equation gives:
T(n) = (n lg n)
Parallelizing the Sorts
One way to parallelize the sorts is:
Divide the data among the processors
Sort the data on the individual processors.
Merge the various data
Note that the merge operation is a reduction operation !
And please look at test.pas a parallel quicksort on many cores - compile and execute it...
You can download parallelsort library from:
http://pages.videotron.com/aminer/Language: FPC Pascal v2.2.0+ / Delphi 7+:
http://www.freepascal.org/Operating Systems: Win , Linux and Mac (x86).
Required FPC switches: -O3 -Sd -dFPC -dWin32 -dFreePascal
-Sd for delphi mode....
Required Delphi switches: -DMSWINDOWS -$H+
For Delphi 5,6,7 use -DDelphi
For Delphi 2005,2006,2007,2009,2010+ use the switch -DDELPHI2005+
Thank you.
Amine Moulay Ramdane.