Advanced Computer Architecture and Parallel Systems
Course Subject:
Message Passing Interface (MPI).
MPI is a library that can be used in C (or Fortran) and it allows for the cloning of a single program into multiple copies which execute in many machines. Each clone has a unique id and so they can actually execute different pieces of code within the same program. This is the so-called Single Program Multiple Data (SPMD) parallel programming paradigm. Then the machines communicate by message passing functions provided by the library. MPI is a set of recommendations (protocol) and there are many open source implementations of it. It is recommended to use
MPICH2
from Argonne National Labs.
Code samples in C:
- Simple Communication with MPI_Send - MPI_Recv
- Demonstrate MPI_Allgather and MPI_Scatter
-
Parallel Vector Multiplication.
The program requires some input file with the values of the vectors to be multiplied. You may use one of the following files dotprod.dat, dotprod1.dat, dotprod2.dat,
or you can create yourown file with the following format:
n
x1 x2 ... xn
y1 y2 ... yn
trueprod
where n is the vector dimension and trueprod is the actual inner product used for verification.
Bibliography
- Peter Pacheco, Parallel Programming with MPI, Morgan Kaufmann, 1997
- Peter Pacheco, An Introduction to Parallel Programming, Morgan Kaufmann, 2011