You are on page 1of 1

MA721: MPI programming assignment

Note: Implement the following in MPI. The report should be submitted through Moodle.

I. Write an MPI program to find maximum value in an array of 600 integers with 6 processes and
print the result
in root process using MPI_Reduce call. Compute time taken by the program using MPI_Wtime()
function.

2. a. Write a MPI parallel program o find the minimum and maximum element in a given array of
large size N.
b. Your code should allow easy changing of parameters like the number of processors, the input size
n. Use random function to generates random numbers.
c. Prepare a brief report of your experiments (for e.g. give tables that show the runtime of the two
programs(serial and parallel) for varying number of processors, input size N, etc).

3. The value of π is computed mathematically as follows:


1
∫ 4 / ( 1+ x 2 ) =ππ
0
Write a MPI program to compute π using MPI _Bcast and MPI _Reduce. Compare execution time
for serial code and parallel code

4. Write MPI program to generate a hostogram of Marks scores in a class of strength 125. Choose
the appropriate bin size for the problem.

5. Write MPI parallel program for to compute the area under a curve using trapezoidal rule. Test
your program by varying the number of intervals.

*******

You might also like