Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi please help with this lab in c++ Parallel Odd-Even Transposition Sorting Assume there are 16 processing nodes and each node will generate a random

Hi please help with this lab in c++ image text in transcribed
image text in transcribed
Parallel Odd-Even Transposition Sorting Assume there are 16 processing nodes and each node will generate a random number in the range of [1, 256]. Then use Odd-Even Transposition Sorting to sort the numbers and print out the sorted list. 1. Revise your program such that a total of 256,000 random numbers between 1 and 100,000 are generated by the root node and broadcasted to the other nodes. The total number of items, N, will be partitioned into N/P subsections. Each node then sorts its N/P numbers locally using the O(N2), sequential sorting algorithm Bubble Sort or equivalent. Next, use an Odd-Even Transposition Sorting algorithm to sort all the numbers. Here, each prscessor pair transfer of their number to the neighboring processor in such a way that the higher numbers transport to the higher processor numbers and the lower numbers to the lower processors. Print out the last 100 numbers of the resulting sorted list to verify that it is working. 2. 3. Time the program for various number of processors: a. Run the program as a serial code with only one processor using the quadratic sorting algorithm, Bubble Sort or equivalent. b. Run the program with P-2, 4, 8, 10, 20, 16, 32 and 64 processors. c. Tabulate and graph the timing required by the program. d. Calculate and graph the specdups. e. Discuss the results in terms of the number of processors and the quadratic nature of the sorting algorithm. 4. While the detail assumptions of Gustafson's law are somewhat different than this example, the concept of the advantage of being able to increase the size of a problem for a certain number of processors is relevant. Run your program for a few different combinations of N and P and see how many numbers you can sort with your parallel Parallel Odd-Even Transposition Sorting Assume there are 16 processing nodes and each node will generate a random number in the range of [1, 256]. Then use Odd-Even Transposition Sorting to sort the numbers and print out the sorted list. 1. Revise your program such that a total of 256,000 random numbers between 1 and 100,000 are generated by the root node and broadcasted to the other nodes. The total number of items, N, will be partitioned into N/P subsections. Each node then sorts its N/P numbers locally using the O(N2), sequential sorting algorithm Bubble Sort or equivalent. Next, use an Odd-Even Transposition Sorting algorithm to sort all the numbers. Here, each prscessor pair transfer of their number to the neighboring processor in such a way that the higher numbers transport to the higher processor numbers and the lower numbers to the lower processors. Print out the last 100 numbers of the resulting sorted list to verify that it is working. 2. 3. Time the program for various number of processors: a. Run the program as a serial code with only one processor using the quadratic sorting algorithm, Bubble Sort or equivalent. b. Run the program with P-2, 4, 8, 10, 20, 16, 32 and 64 processors. c. Tabulate and graph the timing required by the program. d. Calculate and graph the specdups. e. Discuss the results in terms of the number of processors and the quadratic nature of the sorting algorithm. 4. While the detail assumptions of Gustafson's law are somewhat different than this example, the concept of the advantage of being able to increase the size of a problem for a certain number of processors is relevant. Run your program for a few different combinations of N and P and see how many numbers you can sort with your parallel

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Theory Icdt 97 6th International Conference Delphi Greece January 8 10 1997 Proceedings Lncs 1186

Authors: Foto N. Afrati ,Phokion G. Kolaitis

1st Edition

3540622225, 978-3540622222

More Books

Students also viewed these Databases questions

Question

What is dividend payout ratio ?

Answered: 1 week ago

Question

Explain the factors affecting dividend policy in detail.

Answered: 1 week ago

Question

Identify the elements that make up the employee reward package.

Answered: 1 week ago

Question

Understand the purpose, value and drawbacks of the interview.

Answered: 1 week ago