Parallel Quick Sort Algorithm
Parallel Quick Sort Algorithm
Prepared by:
Zhao Chengyan 255459
_________________________________
I hereby claim that this project is finished by myself only and not any portion of
which is copied from any other people.
Index
1. Sequential quick sort algorithm
1). Algorithm description with examples
2). Performance analysis
1>. Average performance
2>. Performance in worst case
3). Idea to derive the parallel algorithm
2. Traditional parallel quick sort algorithm
1). Algorithm description
1>. Algorithm in master
2>. Algorithm in slave
2). Performance analysis
1>. Analysis in mathematics
2>. Analysis in diagram:
1)>. Execution time
2)>. Speed up
3)>. Efficiency
4)>. Load balance
3. PVM optimized parallel quick sort algorithm
1). Algorithm description
1>. Algorithm in master
2>. Algorithm in slave
2).optimization mechanism for PVM
1>. Optimization mechanism
2>. Reasons to optimize
3). Performance analysis
1>. In mathematics
2>. In diagram
1)>. Execution time
2)>. Speedup
3)>. Efficiency
4)>. Load balance
4). Comparison with traditional one: same problem size
1>. Execution time
2>. Speedup
3>. Efficiency
4>. Load balancing
5>. Reason analysis & Conclusion
4. Reference
5. Appendix
1> A-1: traditional parallel quick sort master algorithm.
2>.A-2: traditional parallel quick sort slave algorithm.
3> B-1: PVM optimized parallel quick sort master algorithm.
4>.B-2: PVM optimized parallel quick sort slave algorithm.
/* please note: all the results show on the graph are generated from the arithmetic average of 5 times
testing, it is fair. */
3). un-satisfaction:
With the program developed for the traditional parallel quick sort algorithm, it does work, but has a very
low speedup(large number of idle processes show in graph above) and a lot of time is spent in message
transferring, no in computation.
Thus, I have a idea to optimize it in PVM programming environment.
The improvement would be made mainly on message transferring:
1>. Increase the message size;
2>. Decrease the message number;
To make a system has a better granularity.
4). Conclusion:
Comparing with the different execution time of the same parallel quick sort algorithm, we found that
the PVM optimized one could execute almost as half time as the traditional one.
It means that my PVM optimization get a complete success, the message transferring time is greatly
reduced.
4. Reference
1). Data structure , 1981, TsengHua University press
2). Parallel & Distributed computing, Akl, Prentice Hall
3). Journal of Parallel & Distributed Computing, 1993, A parallel quick algorithm
5. Appendix
1). A-1: traditional parallel quick sort master algorithm: source code with comments
Programming in C code, cc compiler under Unix..
2).A-2: traditional parallel quick sort slave algorithm: source code with comments
Programming in C code, cc compiler under Unix.
3) B-1: PVM optimized parallel quick sort master algorithm: source code with comments
Programming in C code, cc compiler under Unix.
4).B-2: PVM optimized parallel quick sort slave algorithm: source code with comments
Programming in C code, cc compiler under Unix.