Due: Friday, April 19 by 12 pm.
Problem
The purpose of this assignment is to introduce you to the ideas behind
parallelizing iterative solvers for PDEs and related problems. Your goal
is to parallelize a toy 3D Poisson problem solver based on preconditioned
conjugate gradient iteration. The serial code is given; you should write
an OpenMP or MPI version that (one hopes) gives reasonable speedup over
several processors. The starting point serial code is documented here. You should:
- Time the unpreconditioned serial code on the crocus cluster. How
much time does it take to solve different problem sizes? How much time
is spent in multiplying by A? In doing dot products?
- Repeat your timing experiments with the preconditioned iteration.
How much time is spent in the preconditioner per step? How many steps
do the preconditioned iterations take?
- Parallelize the unpreconditioned code. You may use MPI or OpenMP;
if you use OpenMP, you should think carefully about organizing your
code to avoid contention effects and excessive synchronization. Often
the fastest shared memory programs look very much like their
message-passing counterparts! Be guided by what you find in your timing
experiments -- if you neglect to parallelize the most time-consuming
parts of the code, you will not get good performance.
- Parallelize the Schwarz preconditioner. If you find yourself short
on time, at least make sure you handle the embarassingly parallel block
Jacobi case (Schwarz with no overlap).
- Do scaling studies of the time required by your code for different
values of the mesh size n and the number of processors p.
Source Code
You may start with the serial implementation supplied below.
|
- hw3code.pdf
- a document explaining the structure of the code using my
literate programming tool dsbweb.
- cgp3d.c
- code for the Laplace operator, preconditioners, and
driver,
- pcg.c, pcg.h
- a serial PCG implementation,
- params.c, params.h
- solver parameters and command-line processing,
- timing.c, timing.h
- basic stopwatch timing utilities,
- Makefile
- a makefile that should work on crocus
- Makefile.in
- machine-specific settings used by the Makefile
- cgp3d.tgz
- all above files (and more!) in one tarball.
|
Submission
You may work in groups of 2 or 3. One person in your group should be a
non-CS student (if possible), but otherwise you're responsible for
finding a group. You do not have to have the same groups as last time.
You will want to submit your report via CMS.
Resources