Assignment
Assignment 8: Parallelized Laplace solver
Completion requirements
Opened: Thursday, 21 March 2024, 12:00 AM
Due: Thursday, 28 March 2024, 11:59 PM
In this assignment, you will parallelize a given serial solution to assignment 5, i.e., a two-dimensional Laplace equation, and assess its scaling performance. Note that this code also implements output to netCDF.
Note (Sat March 23, 10:25 am): Much of the parallelization in the code has already been done, but go through the steps below nonetheless, as the code modification itself is only a small part.
Your assignment is as follows:
- First, git clone /scinet/course/phy1610/omplaplace. Then
'cd omplaplace', 'source teachsetup' and 'make' will create 'laplace'. - The code will accept command line arguments corresponding to the maximum iteration steps, the size of the grid, and the convergence tolerance. Without arguments, those are set to the default values of 1e5, 501, and 1e-6, respectively.
- Before parallelizing the code, profile this application line-by-line with gprof. Remember to (re)compile it with the "-g -pg" flags.
- From the output of gprof, identify the two costliest loops in the program, and make sure they are properly parallelized with OpenMP.
- Write a single jobs script for the teach cluster that will run the parallelized laplace code with default parameters for 1, 2, 3, etc. up to 16 threads. The script (or the code itself) should time these calculations and store them in a table of thread numbers and corresponding runtimes in a file.
- Submit the job to the Teach cluster's scheduler and collect the timing output.
- Assuming that the timings follow Amdahl's law, determine the value of the 'serial fraction'.
To your repo, you should also add a short report containing:
- The output of gprof of the serial version.
- The two loops you identified as the most costly ones.
- The timing results of the parallelized code as a function of the number of threads, and the corresponding speed-ups.
- A mention of the value of the serial fraction you determined.
- A plot of the speed up with the curve of Amdahl's law.
As before, we expect you to use git and have several meaningful commits.
Submit your work by March 28, 23:59 PM. The usual late penalty applies.