Question: i need help urgent Option 1 ( Using MPI environment. Modified version of Q 3 . 2 6 , P . 1 4 7 )
i need help urgent Option
Using MPI environment. Modified version of Q P
Q: Serial oddeven transposition sort of an nelement list can sort the list in considerably fewer than phases. As an extreme example, if the input list is already sorted, the algorithm requires phases.
Write a serial oddeven transposition sort program.
Modify the serial oddeven transposition sort program, by including a serial Issorted function that determines whether a list is sorted, so that it checks whether the list is sorted after each phase.
Write a parallel oddeven transposition sort program.
Find the speedups and efficiencies of the parallel oddeven sort. Does the program obtain linear speedups? Is it strongly or weakly scalable?
Hint:
The oddeven transposition sort is a variation of bubble sort. Like in bubble sort, elements of a list are compared pairwise and swapped when necessary. However, these compareswaps are done in two phases: odd and even.
Option :
Using OpenMP environment. Modified version of Q P
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 ai in the list a we count the number of elements in the list that are less than ai Then we insert ai 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 and then count being "less than" After the algorithm has completed, overwrite the original array with the temporary array using the string library function memcpy.
try parallelize the for i loop outer loop which variables should private, and which should shared?
parallelize the for i loop using the scoping you specified the previous part, are there any loopcarried dependences? Explain your answer.
Can parallelize the call memcpy? Can modify the code that this part the function will parallelizable?
Write a parallel Count sort program.
How does the performance your parallelization Count sort compare serial Count sort? Find the speedups and efficiencies.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
