Assignment
Assignment 8: Parallel two-dimensional wave equation.
Completion requirements
Opened: Friday, 24 March 2023, 12:00 AM
Due: Friday, 31 March 2023, 11:59 PM
In this assignment, you will parallelize a given two-dimensional damped wave application wave2d (e.g., the partial solution to the 4th assignment), and assess its scaling performance. Note that this code also implements output to netCDF if the output filename has extension ".nc".
Your assignment is as follows:
- First, git clone /scinet/course/phy1610/a8_wave2d. Then
'cd a8_wave2d', 'source teachsetup' and 'make' will create 'wave2d' - This repository contains a wave parameter file 'longwaveparams.txt' that should be used for all runs (i.e., do not use the parameters in waveparams.txt, as that needs so little computational load that it would not show the advantages of parallel programming).
- Before parallelizing the code, profile this application line-by-line with gprof. Remember to (re)compile it with the "-g -gstabs -pg" flags.
- From the output of gprof, identify the two costliest loops in the program, and parallelize those with OpenMP.
- Write a single jobs script for the teach cluster that will run the wave2d code with longwaveparams.txt for 1, 2, 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 result 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 31, 23:59 PM. The usual late penalty applies.
- 24 March 2023, 5:01 PM