9. Parallel Wave Analysis
For this assignment, start with a serial code "analysewave.cpp" that can analyze the output of the wave1d application.
The code can be compiled with the Makefile and can be run by giving two arguments: the name of the input netcdf file and the name of the output file to create. E.g.
./analysewave longresult.nc output.txt
The file "longresult.nc" can be found in the directory /scinet/course/phy1610/analysewave, along with the code. Copy this directory over to your $SCRATCH on the teach cluster. Note that the netcdf file is fairly big (4.5GB).
Your task is to parallelize the analysewave code.cpp using two methods:
- OpenMP, using "parallel for" and reduction variables.
- MPI, using domain decomposition and MPI_Reduce calls.
Create two versions of the code, called analysewave-omp.cpp and analysewave-mpi.cpp. Using job scripts, measure the runtime of analysewave-omp as a function of the number of threads from 1 to 16. Also measure, in a job script, the runtime of analysewave-mpi as a function of the number of processes from 1 to 32 (for which you will need multiple nodes).
You should see rather non-Amdahl-like behaviour. Put the timing results in a file "report.txt", and add an explanation of the observed behaviour in a short (~ 2 paragraph) report.
Submit the Makefile, the two new versions analysewave-omp.cpp and analysewave-mpi.cpp, and your timing results and explanation in the file report.txt.
- 3 April 2022, 11:20 PM
- 3 April 2022, 11:20 PM