Parallel Computing (CMSC416/CMSC616)

Assignment 0.2: Running an MPI example

Due: September 24, 2024 @ 11:59 PM Eastern Time

The purpose of this programming assignment is to gain experience in running an example MPI program on zaratan. You will find this MIT course and command line reference useful.

Steps to Follow

  • Download cpi-mpi.c, an MPI program that calculates the value of Pi in parallel, to zaratan. You can either clone the git repository on zaratan or download the file locally to your laptop first and then scp to zaratan.
  • Compile cpi-mpi.c using mpicc:
    mpicc -O2 -o cpi-mpi cpi-mpi.c
    Also, get familiar with using make. A sample Makefile is here. If make throws an error, you might need to load mpi first using: module load openmpi/gcc.
  • Run the code by submitting a batch job using sbatch and a batch script on 1 and 16 processes. The batch script that is provided is hard-coded for a 16-process run.
  • Run the code as an interactive job using sinteractive on 1 and 16 processes. More details on that are on the Zaratan quick primer page.
What to Submit

You must submit the following files and no other files in a single tarball with extension .tar.gz (delete the executable and any other files not mentioned below before using tar):

  • cpi-mpi.c
  • Makefile that will compile your code successfully on zaratan when using mpicc or mpicxx.
  • Output files from running the batch job on 1 and 16 processes. These files should be named myfile-1.out and myfile-16.out respectively. You only need to submit the output from the batch jobs and not the interactive jobs.
You should put the code, Makefile and output files in a single directory (named LastName-FirstName-assign0.2), compress it to .tar.gz (LastName-FirstName-assign0.2.tar.gz) and upload that to gradescope.

Resources

Grading

This assigment is for 0 points. However, all students are required to complete the assignment. The autograder for this assignment will check that you created the tarball correctly.