Sorting an array of elements is a common task in several applications. There exist several algorithms to sort a list, with their advantages and drawbacks. One of the most widely used and studied is merge-sort, which follows a divide-and-conquer approach with the following steps:
a. Divide the unsorted list of length n in np fragments of length p.
b. Order the fragments independently.
c. Merge the fragments by pairs in order to have sorted fragments of size 2 × p. Perform the merge iteratively until you obtain the final sorted list.
Fig. 10.9 illustrates an example of a parallel UPC++ version of the merge-sort algorithm mapping the different fragments of the list to different parts of the global memory. Each fragment must be sorted by certain threads in order to minimize remote memory accesses.

"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
Looking for a Similar Assignment? Our Experts can help. Use the coupon code SAVE30 to get your first order at 30% off!