Parallel Optimization Strategy of Heap Sort Algorithm under Multi-core Environment

With the popularity of multi-core and many-core platform, multi-core-oriented parallel programming and optimization has become a research hotspot in computer field. However, the vast majority of programmers are still continuing the traditional serial programming habits. Meanwhile, the mainstream algorithms are still in serial. Therefore, how to parallelize the serial programs effectively and write the multi-core programs efficiently is becoming an urgent problem in the field of multi-core programming. In this paper, the optimization of the heap sort algorithm has been achieved adopting the parallel technology based on openMP. Firstly, based on the hypercube model, the heap data to be sorted are divided into n (n is the computer thread amount) blocks called sub-heap which will be sorted respectively. Thus, the scale of the problem is decomposed into 1/n, secondly, the sorted sub-heaps will be merged using merge sort algorithm, finally, the parallel optimized heap sort algorithm is compared to the traditional heap sort algorithm. When the data quantity comes up to ten million bytes, the execution efficiency of the optimized parallel heap sort algorithm of this paper is improved significantly compared with the traditional serial heap sort algorithm on the experimental computer. Furthermore, the efficiency gap between the two algorithms will be intensified prominently with the increasing data quantity.