Assignments for B673, Spring 2009

  1. Main project is to implement the conjugate gradient (CG) algorithm for a linear system with a dense 2D array as coefficient matrix, on a serial computer. This is a first step towards developing a parallel CG algorithm for sparse matrices. The full set of steps is
  2. Write a serial version first and make sure it is correct. The Matlab version of CG can be used for setting up the linear system. If your code writes out the solution vector to a file, it's easy to add a few lines to Matlab main script to read it in and check it against the real solution. See the link main project for more details.
  3. Write a parallel version of CG that uses block row partitioning. In this case, you will need the files that hold the linear system to only contain the block rows of A and the corresponding part of b. I'll provide a Matlab code that does this.
  4. Test it and give a speedup and parallel efficiency plot. I find that easiest to do by having the C/Fortran code write out the data to a Matlab file, rather than transferring timings from the parallel code manually.
Notice: files have been added to the Matlab material, for generating sparse matrices. See the project page for the additions.


A PDE discretizer in Matlab has been added for creating sparse matrices. However, you need to edit it to produce the separate files coeffmat.001, coeffmat.002, ...


  • Edited, Thu 09 Apr 2009, 03:07 PM to point out addenda.
  • Edited, 2009-Apr-21 18:22:40 to add a serial CG tar ball.