CS621: Spring 2014
Project 1: (Due on March 12, 2013, 3:50PM) Experiencing MPI
This project helps you gain some experience by setting up an MPI environment
and running some sample MPI
programs on your own computer.
You can learn about MPI programming
from the class notes, "Programming Using
Tutorial on MPI: The Message Passing Interface.
A sample MPI program
You may begin by compiling and running a sample
In order to run this sample program you must:
- Visit http://www-unix.mcs.anl.gov/mpi/mpich2/ to download
a copy of the MPI software to install on your own computer.
- Read the manual to see how the MPI environment can be installed
on your computer.
- Download the following files.
- You can compile the files explicitly.
- type: mpicc -lm cpi.c , for C program
- type: mpif90 pi3.f, for Fortran program
- To run these programs.
- Specifying number of processes :
mpirun -np 3 executable-file.
Once you got your program running, you should do the following
exercises to get a feeling of parallel computing. (20 points)
- Add an MPI function to compute and print out the time elapsed between
the computations (see Tutorial on MPI: The Message-Passing Interface).
- Choose the number of nodes (intervals) to be a large number,
and run the program by specifying 1, 2, 4, 8, 16, 32 etc. processes and
record the elapsed time.
- Choose the number of nodes (intervals) to be a smaller number, say, 200, and
repeat the above procedure.
- Graph the relation between the number of processes and the timings.
- Modify the code so that you will not use MPI_Reduce to collect
the final result. Instead, ask each process to send its local sum to the
process 0, which will compute the final sum and output the result.
- Submit a print-out of your code, two graphs showing the above tests, and
a short explanation on the results you obtained.
Return to Jun Zhang's: