Poisson's equation
In this lab you are going to use MPI to
parallelize a simple algorithm (finite differences andJacobi's method)
to solve Poisson's
equation on the unit square, using Dirichlet
boundary conditions. Since the text requires mathematical notation
I have use LaTeX instead of HTML. Here is the
text:
Here are the details about zero indices
and dynamic memory allocation.
2008-05-22: I have been asked about how large the errors may be. Here are some examples (delta is the error in Jacobi, and err is the error in the solution):
n | delta | err |
20 | 1e-5 | 8.7e-4 |
20 | 1e-7 | 1.4e-5 |
20 | 1e-9 | 1.6e-5 |
100 | 1e-5 | 2.1e-2 |
100 | 1e-7 | 2.1e-4 |
100 | 1e-9 | 2.0e-6 |
100 | 1e-11 | 7.0e-7 |
A hint on debugging the parallel version: if you let different processes write, it may be hard ro read the output, since it usually becomes interleaved. In my program I opened four files, F0, F1, F2 and F3, say, and let each process write on its own file (the process with rank 2 writes on F2 etc). You can read about files, in Fortran and C, in the hints for the OpenMP-lab.