Question: 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
}
 Find the Parallel Sum Using Divide and Conquer 41. Assume there

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 Databases Questions!