Question: i need solution ASAP ( Using OpenMP environment. Modified version of Q 5 . 3 , P . 2 6 8 ) Q: Count sort

i need solution ASAP
(Using OpenMP environment. Modified version of Q 5.3, P.268)
Q: Count sort is a simple serial sorting algorithm that can be implemented as follows:
Hint:
The basic idea here is that for each element a[i] in the list a, we count the number of elements in the list that are less than a[i]. Then we insert a[i] into a temporary list using the subscript determined by the count. There is a slight problem with this approach when the list contains equal elements, since they could get assigned to the same slot in the temporary list. The code deals with this by incrementing the count for equal elements based on the subscripts.
If both a[i]==a[j] and a[j]a[i]j, then we count a[j]as being "less than" a[i]. After the algorithm has completed, we overwrite the original array with the temporary array using the string library function memcpy.
(1)Ifwe try to parallelize the for i loop (the outer loop), which variables should be private, and which should be shared?
(2)Ifwe parallelize the for i loop using the scoping you specified in the previous part, are there any loop-carried dependences? Explain your answer.
(3) Can we parallelize the call to memcpy? Can we modify the code so that this part of the function will be parallelizable?
(4) Write a parallel Count sort program.
(5) How does the performance of your parallelization of Count sort compare to serial Count sort? Find the speedups and efficiencies.
i need solution ASAP ( Using OpenMP environment.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!