Abstract

A multi-way parallel merging algorithm is described to merge two sorted lists each with size N on a shared-memory parallel system. The structure of this algorithm is very regular and highly parallel. It is shown that using P processors, the time complexity of this algorithm is O( N/ P) when N ⩾ P 2, which is known to be optimal. This approach for parallel merging leads to a multi-way parallel sorting algorithm with time complexity O( N log N)/ P) when N ⩾ P 2. Clearly this is also optimal. In addition, these two algorithms do not require reading from or writing into the same memory location simultaneously, hence they can be applied on a EREW machine. In cases when N < P 2, we recursively apply this merging algorithm to show that for P = N (2 k −1)/ 2 k , the complexities of the merging algorithm the sorting algorithm are O(3 k N/ P) and O(3 k ( N log N)/ P) respectively.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call