Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

This program is a variation on programming assignment 3.4. You are to prepare an MPI program that computes a global sum using a butterfly construct. In this case, you merely have to prepare the program for comm_sz (or p) to be a power of 2.
Do not use the MPI_Allreduce or similar calls for message passing communication. You are only allowed to use MPI_Send, MPI_Recv, and/or MPI_Sendrecv (the last one may be most preferable to avoid deadlock situations when implementing the butterfly structured communication).

Other Requirements

Previously, you were required to use a command-line parameter to obtain the number of processors. In fact, it's more appropriate and easier to use the MPI_Comm_size function to determine the number of processors. You can do this either way, but I guarantee I will not test the program with numbers other than 1, 2, 4, 8, 16, 32, etc. (i.e. powers of 2).
Use the number of processors also as a random number seed. Simply generate an array with as many integer elements as there are processors.
The contents of the array should be distributed by process 0 to all other processes - i.e. one value per process.
The output of the program is each process reporting the global sum it determined. For ex, assume a program run on 4 processes generated the following values: 24 3 19 5. It is easy to figure out (by hand) that the global sum should be 51, so the output of the program should be similar to:

process 0: 51
process 1: 51
process 2: 51
process 3: 51

Note that the processes won't necessarily report things in numeric order - i.e. they are allowed to simply print their result when finished, so it's likely they will not be printed in numeric order.
Name your main program prog04.cpp. You can leave it in your home directory (or a subdirectory), where I will examine it. Otherwise, you can upload a copy of the program in a zip file, if you wish.

In your comment block to begin your main program, other than the function of the program and the variable dictionary, include a set of comments of the following format. It is very important for you to include your name, the compiler you used, the due date, and the program identity:

// Name: Joe M. Student
// Program: CSC 478/578 Program 4


Your program should follow "reasonable" rules of style, with appropriate indentation and commenting.

Required minimum 2 page

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M981118

Have any Question?


Related Questions in Computer Engineering

Discuss how a successful organization should have the

Discuss how a successful organization should have the following multiple layers of security in place for the protection of its operations: Information security management. Data security Network security

Question what steps should be taken to detect alleged

Question : What steps should be taken to detect alleged industrial/cyberespionage? Discuss the implications of each of the steps proposed.

Poblem 1 a firms production function c is given by c q

Problem 1. A firm's production function C is given by C (q) = 0:5q 2+2q 1 2 +18, where q is the level of output. (i) Calculate marginal costs (ii) If all fixed costs are sunk, and the minimum price at which this firm wil ...

Explain a business process you are familiar with describe

Explain a business process you are familiar with. Describe how a computer-based information system is related (or used) in this business process. Explain how a computer-based information systems can improve the efficienc ...

Write a program that populates an array named weekday from

Write a program that populates an array named weekday from the string SunMonTueWedThuFriSat, and then prints each day in uppercase. PERL Language

You are required to design a circuit that takes as input a

You are required to design a circuit that takes as input a serial bit and outputs a '1' whenever there are three successive '1's, i.e., whenever the sequences 111 or 000 occur. Overlaps must be considered Also, assume th ...

Recall that the op-code and operand are represented in

Recall that the op-code and operand are represented in memory by HEX numbers (e.g., LDAA $3000 will show in memory as $B6, $30, and $00). Write a short program to use the commands LDAA and STAA to load and store a value ...

Case study - social media research facilitytaskthis

Case study - Social Media Research facility Task This assignment follows from the case study used in Assessment . For the same case study, complete the following tasks by creating the following: WBS first using indented ...

A sequence of natural numbers a1 a2 an is said to be a

A sequence of natural numbers (a 1 , a 2 , ..., a n ) is said to be a degree sequence if there exists an undirected graph on n vertices {v 1 , v 2 , ..., v n } such that the degree of v i  is a i  for each i = 1, 2, ..., ...

The equation of regression line for sons heighty in inches

The equation of regression line for son's height(y) in inches versus father's height in inches is y = 35 + 0.5x. For a 72 inch tall father, what would we predict for the son's height?

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As