You are on page 1of 13

Harshil Shah

201070033
PC Lab

Experiment 7

Aim: To implement programs using Message Passing Interface (MPI).

1) To write a simple MPI program for calculating Rank and Number of


processor.

Program:

Output:
2) To write an MPI program for Pi calculation.

Program:
Output:
3) To write an advanced MPI program that has a total number of 4
processes, where the process with rank = 0 should send VJTI letter to all
the processes using MPI_Scatter call.

Program:

Output:
4) To write an advanced MPI program to find the maximum value in array
of six integers with 6 processes, and print the result in root process using
MPI_Reduce call.

Program:

Output:
5) To write an MPI program for Ring topology.

Program:
Output:

You might also like