Homework 2 -- Due Tuesday, 25 January For this problem, you will implement a 2D finite difference method for solving Poisson's equation -Delta u = f using the 5 point stencil on an n by n mesh and compare 1D and 2D data decompositions. 1.) Analyze the communication and computation costs for using a one-dimensional data distribution and using a two-dimensional data distribution. How does the ratio scale with n and p? 2.) Implement the matrix-vector product for both data decompositions. You can test your result by taking some smooth function (say sin(pi x) sin(pi y), evaluating at all the grid points, and seeing if you get something close to the Laplacia) 3.) Solve the system -Delta u = f , u = 0 on the boundary with f = -pi * pi * sin(pi x) * sin( pi y ) using conjugate gradient iterations (explained in class on 1/20) 4.) Perform a scaling study, with fixed work per processor (for a range of different work) and for a fixed (very big) problem size with variable number of processors. Some notes to consider: 1.) You might consider learning how to use gnuplot to make timing plots (there are Python bindings installed for Gnuplot -- you can import Gnuplot and learn about it, or you can print out files from one node) 2.) There is a simple graphics package available as part of MPI. It can plot points and lines, and may be appropriate for use. 3.) There are now 6 debian unstable machines -- you should add california and kimball to your hosts file. In either case, you can perform your scaling studies by writing an appropriate loop and having your code print a table (gnuplot file, latex table, whatever). Be smart -- it saves time.