Question: Parallel computing COMP 4073: Homework #2 Due: 11/12/2018, Monday Merge sort is one of divide-and-conquer algorithm to sort a list of items efficiently. The following
Parallel computing COMP 4073: Homework #2 Due: 11/12/2018, Monday Merge sort is one of divide-and-conquer algorithm to sort a list of items efficiently. The following is the Pseudo code of merge sort. In this homework, you need to 1) write a merge sort C++ serial program using recursion; and then 2) write an OpenMP C++ program to parallelize your merge sort program using OpenMP tasks. 3) test your serial and OpenMP merge sort program using a list of random numbers with size of 10,000,000, report the speedup of your OpenMP program vs. your serial program. Algorithm 1: MergeSort(A) Input Array A of length n Output: Sorted A 1 if n is 1 then 2return A 3 end 4 else 7 return Merge(L, R) 8 end Your grade will be not only determined by the correctness of the total number, but also depends on your program performance. Report the speedup of your program using 1, 2, 4, and 8 threads respectively
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
