CS 336: Project #11

Project 11: Counting with MPI

In this project, you will be writing straight-forward MPI (message passing interface) code and running it on NSCC. The goal of the project is to become comfortable with the new environment.

  1. Read the first three section of Ch. 6 in Introduction to Parallel Computing (that is, read up through the MPI section).
  2. Write count_3s using MPI. Allocate the array in the root process, scatter it to the rest of the processors, then reduce the counts from the different processes. The root process should print the result. To compile your code, use mpicc:
    /usr/lib64/openmpi/bin/mpicc count_3s.c -o count_3s
    
  3. To test your code, you should use 16 processors on nodes n3 and n5. E.g.
    /usr/lib64/openmpi/bin/mpirun -np 16 -host n0,n3 counts3s
    
  4. Time the different sections of the code using MPI_Wtime. Which parts take the longest? Be sure to vary your problem size so that you can detect any trends.
  5. For the final project, you will be comparing timings for all four versions of your fish-schooling code (sequential, pthreads, GPU, and MPI). Why don't you take the time now to make sure the first three versions are all using the same fishStep code? You will be building your MPI version on your sequential version. Make sure you will be able time the code for all four.

Extensions

Write an MPI program to compute the dot product of two vectors. What is the N at which it becomes faster to use MPI than to do it sequentially?

Writeup and Handin

To hand in your project, you will gather all of the necessary files into a proj11 directory under your "turnin" directory on nscc.

  1. Create a file named README.txt for your project write-up. Include a description of the process you used to determine that your code produces correct results. Also include the analysis outlined earlier. The more thorough the analysis, the higher your grade will be.
  2. You should hand in all code necessary to run your solutions. Place all necessary .h, .c, and Makefile files in the proj11 directory. Stephanie will probably want to compile and run the code. It should be possible to do so without looking for any more files.

Email Stephanie to let her know your project is ready for grading.