Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Find the Parallel Sum Using Divide and Conquer 4 1 . Assume there are 8 processing nodes and there are 2 5 6 numbers (

Find the Parallel Sum Using Divide and Conquer
41. Assume there are 8 processing nodes and there are 256 numbers (1,2,dots,256) to be added. The original list is initialized at processor 0, and then is divided into two halves to broadcast level by level until the leaves are reached as shown below (each processor will have 2568=32 numbers).
After each processor receives its final sublist (32 numbers), it calculates its partial sum. The partial sums will be reduced level by level as shown below. The final sum will be obtained and printed out on processor 0.
IMPORTANT: Use the below 2 for loops to write the code in C (MPI Programming)
for (i = log2P-1; i=0; i--){
if (id and (2^(i)-1)==0
if (id and (2^(i+1)-1)==0)
MPI_Send (,id^(2^(i)),);
else
MPI_Recv (,id^(2^(i)),);
for (i=0; i=log2P-1; i++{
//insert code here
}
image text in transcribed

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 Principles Programming And Performance

Authors: Patrick O'Neil, Elizabeth O'Neil

2nd Edition

1558605800, 978-1558605800

More Books

Students also viewed these Databases questions