This lab is intended to introduce you to MPI. For your enjoyment, you are provided with a version of the SAT code discussed in class.
Also, you will edit skeleton code to pass messages around in a circle, and to exchange messages between consecutive processes. This exercise is not about speed up, it is just about learning to write message passing code. Still, there is timing code provided, so you can see how to time in MPI. In the CS lab we use openmpi. Download and untar the provided mess.tar file.
Make sure you have openmpi in your path and library load path, when running on CS machines:
echo $path ... /usr/lib64/openmpi/bin . echo $LD_LIBRARY_PATH ...:/usr/lib64/openmpi/lib To set the environment variable in Bash terminals, use the following commands export PATH=/usr/lib64/openmpi/bin:$PATH export LD_LIBRARY_PATH=/usr/lib64/openmpi/lib
mpirun -np 4 exchange 5 100 v
To compile your programs in CRAY Change Makefile: CC = cc (instead of CC = mpicc) To run your programs in CRAY Copy the executables in to "lustrefs" directory To run the program "sat" with 4 processes aprun -n4 sat