MPI - 1D Decomposition

Assignments

The parameters of the algorithm are such:

  1. The grid matrix must be completely distributed, no replicating the matrix on all processors. In this exercise, only use a 1 dimensional decomposition (see Figure 2).

    Figure 2
    Figure 2
  2. The whole process must be parallel, that includes initialization of the grid and boundary conditions, the iterative evolution and the final dump on file of the resulting grid.

  3. Implement an efficient data exchange between processes.

  4. Handle dimensions even if not multiple of the number of processes (optional for merit).

Here is a guideline for the process that parallel programmers use to do this:

  1. Study the serial algorithm and see where parallelism can be exploited. Also think about how the data can be divided. Best way to do this is on a piece of paper, drawing out the layout conceptually before you even touch the code.

  2. Still on paper, figure out how this conceptualization moves to being expressed in the parallel programming language you want to use. What MPI calls do you need to use? Which processors will be doing what work? STILL ON PAPER.

  3. Now begin programming the algorithm up in MPI.

  4. Test the program on a small matrix and processor count to make sure it is doing what you expect it to do.

  5. Once you are satisfied it works, scale it up.

With this in mind, go through this process to implement a 1-D decomposition of the Jacobi iteration algorithm.

Tips