This assignment includes items to be done individually and items that you may do in groups of two. You will need to submit two files. hw04.txt should include your answers to the first two questions and must be done individually. The program for the third item should be submitted as hw04.tar. If you work in a group on the program, only one group member needs to submit hw04.tar. Please use the filenames specified and be sure to include your name in each file.
Some background
Laplace's equation is an elliptic partial differential equation that governs physical phenomena such as heat. In two dimensions, it can be written
Phi_xx + Phi_yy = 0.
Given a spatial region and values for points on the boundaries of the region, the goal is to approximate the steady-state solution for points in the interior. We do this by covering the region with an evenly-spaced grid of points. A grid of 8 ×8 would look like this:
* * * * * * * * * * * . . . . . . . . * * . . . . . . . . * * . . . . . . . . * * . . . . . . . . * * . . . . . . . . * * . . . . . . . . * * . . . . . . . . * * . . . . . . . . * * * * * * * * * * *
The 8 ×8 grid represented by the dots is surrounded by a layer of boundary points, represented by *'s. Each interior point is initialized to some value. Boundary points remain constant throughout the simulation. The steady-state values of interior points are calculated by repeated iterations. On each iteration, the new value of a point is set to a combination of the old values of neighboring points. The computation terminates either after a given number of iterations or when every new value is within some acceptable difference eps of every old value.
There are several iterative methods for solving Laplace's equation. Your program is to use Jacobi iteration, which is the simplest and easily parallelizable, though certainly not the most efficient in terms of convergence rate.
In Jacobi iteration, the new value for each grid point in the interior is set to the average of the old values of the four points left, right, above, and below it. This process is repeated until the program terminates. Note that some of the values used for the average will be boundary points.
What to do and how to do it
You may work in groups of two on this program and its writeup.
Your submitted tar file should include your Makefile, your C source code (including the timer code from class, if you choose to use it), your PBS script(s), and a brief README file that expains how to run your program, describes how and why you chose to parallelize your program, and describes and analyzes your timing results. Please do not include object files or your executable in your tar file.
Honor code guidelines: While the program is to be done only by you (meaning your group, if you choose to work in a group), along the lines of a laboratory program, I want to encourage you to ask questions and discuss the program with me, our TA, and with classmates outside your group, as you develop it. However, no sharing of code between groups is permitted. If you have any doubts, please check first and avoid honor code problems later.
Grading guidelines: Your grade for the program will be determined by correctness, design, documentation, and style, as well as the required items in the detailed comments and README file.