A Program for the Poisson Equation in a Rectangle
This program computes an approximate solution to the Poisson equation in a rectangular region.
The version of Poisson's equation being solved here is
- ( d/dx d/dx + d/dy d/dy ) U(x,y) = F(x,y)
over the rectangle 0 <= X <= 1, 0 <= Y <= 1, with exact solution
U(x,y) = sin ( pi * x * y )
so that
F(x,y) = pi^2 * ( x^2 + y^2 ) * sin ( pi * x * y )
and with Dirichlet boundary conditions along the lines x = 0, x = 1, y = 0 and y = 1. (The boundary conditions will actually be zero in this case, but we write up the problem as though we didn't know that, which makes it easy to change the problem later.)
We compute an approximate solution by discretizing the geometry, assuming that DX = DY, and approximating the Poisson operator by
( U(i-1,j) + U(i+1,j) + U(i,j-1) + U(i,j+1) - 4*U(i,j) ) / dx /dy
Along with the boundary conditions at the boundary nodes, we have a linear system for U. We can apply the Jacobi iteration to estimate the solution to the linear system.
Usage of the application: poisson use_case
poisson 0
(tiny)
poisson 1
(small)
poisson 2
(large)
STEP 0: Create git repository (10%)
Your code should be forked from this repository and hosted on code.it4i.cz as a private project with reporter access for all teachers (bes0030, vys0053, jansik, lriha, mec059, milanjaros, vav0038).
STEP 1: Building the library (10%)
Provide compilation script for your application (the script should run independently on a current path). Script should load all necessary modules and call cmake
.
STEP 2: Analysis of the application (10%)
Use Arm map
(module Forge) to analyze a sequential run of your application with given use case (large
). Identify the most time consuming regions that can be parallelized by OpenMP.
STEP 3: Use OpenMP to run the application in parallel (10%)
Put OpenMP pragmas to a correct positions with appropriate variables visibility in order to utilize more threads effectively.
STEP 4: Test the correctness of the code (10%)
Create script that automatically check correctness of your application for at least 3 different test cases. Comparison can be implemented as comparison of outputs of sequential and parallel runs.
STEP 5: Test the behavior of the code on the Karolina cluster (40%)
- Implement time measurement for all parallel regions using omp_get_wtime().
- Create script for run strong scalability measurement (PBS script).
- Evaluate strong scalability of measured regions up to 128 threads and different thread affinity (compact, scatter, balanced, none).
- Prepare charts for all measurements.
STEP 6: Presentation of your project (10%)
Prepare presentation in form of slides (pptx, pdf). The slides should address all topics requested above.
The presentation (pdf) as well as all other modifications, and outputs push to your git repository.