Parallel Computing (CMSC416/CMSC616)

Assignment 0: Using the Linux Shell on HPC Clusters

Due: Wednesday February 14, 2024 @ 11:59 PM Eastern Time

The purpose of this programming assignment is to gain experience in using a Linux shell and shell commands for tasks such as compiling a program, editing source code, submitting a batch job, and submitting your assignments as tarballs to gradescope. You will find this MIT course and command line reference useful.

Steps to Follow

  • Download cpi.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.c using mpicc. 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.
  • Compress your directory with the code, Makefile and outputs on 1 and 16 processes (saved into different files) into a tarball using: tar -cvzf <tarname>.tar.gz <dirname>
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.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), compress it to .tar.gz (LastName-FirstName-assign0.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.