In order to successfully complete this assignment you need to participate both individually and in groups during class. Have one of the instructors check your notebook and sign you out before leaving class. Turn in your assignment using D2L.
ICA 27: The Message Passing Interface (MPI)#

Image from: https://www.appianimosaic.com/
Agenda for today’s class (70 minutes)#
(20 minutes) Pre class Review
(20 minutes) MPI Code Review
(30 minutes) Rumor Mill Example
1. Pre class Review#
✅ DO THIS: With your group, discuss how MPI is similar/different from OpenMP and CUDA. Summarize your discussion here.
2. MPI Code Review#
Lets explore some MPI code.
Find some example MPI code and get it running on the HPCC
Explore what the code is doing and how it is using MPI
✅ QUESTION: What are the different inputs to the MPI_Send
and MPI_Recv
commands? What do we think they do?
Put your observations here.
✅ QUESTION: What other MPI related commands did you find in your example. What do these commands do?
Put your observations here.
3. Rumor Mill Example#
Consider the code put in the Rumor folder of the CMSE401 git repository. This code uses agent based models to pass “rumors” around a grid of points. In the next couple of classes we are going to review the code and see if we can modify it to use MPI.
Specifically we are going to try and split the simulation into separate grids that share boarders. Each node only needs to keep track of the rumors in its own grid. MPI Send/Recv messages should be used to pass the “boundary” vectors of each grid to it’s neighboring grids after every iteration.
✅ DO THIS: In your groups, go though the provided code and see if it makes sense. Get it to compile and run on the HPCC and do a few baseline benchmarks. See if you can figure out an easy way to split up the work load between computers.
Congratulations, we’re done!#
Have one of the instructors check your notebook and sign you out before leaving class. Turn in your assignment using D2L.
Written by Dr. Dirk Colbry, Michigan State University (Updated by Dr. Nathan Haut in Spring 2025)
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.