Skip navigation

CME 194: Introduction to MPI

Homework 1

This homework has 5 problems. The goal of the first homework is to ensure that you can access the compute resources on campus, compile MPI programs, understand the cost of communication to computation, use MPI_Send and MPI_Recv, and debug your program

Collaboration

You may discuss all aspects of the program with your classmates. However, you should never show any of your code to another student, and you should never copy anyone else's code without an explicit acknowledgment.

1) Matrix-Vector Multiplication

We discussed three different schemes for matrix-vector multiplication in class. Implement all three. Time your results on various matrix sizes and produce a speedup plot for each.

2) Random Walks

Go back to the previous assignment and modify the random walk code so that the probability of a transition can be any value in [0,1].

3) Numerical Integration

Use MPI to implement any numerical integration scheme in distributed memory. For concreteness do 1D quadrature based on say, simpson's rule.

4) Parallel Prefix Sum

Implement the parallel prefix sum algorithm shown in class.

5) AlltoAllv++

Recall the signature of MPI_AlltoAllv shown in class. How would you create an AlltoAllv where each process does not know the sizes of the receive buffers in advance?
There are many solution to this, but, some are more clever than others. Discuss on Piazza.