This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: CS 240A: Applied Parallel Computing // Homework 3 Assigned April 12, 2010 Due by 11:59pm Monday, April 26 You may do this homework in groups of twoin fact, I prefer that you do so. You may form groups however you want, but I encourage groups that have students from two different departments. The object of this problem is to write a parallel program, using MPI, to use conjugate gradients (CG) to solve the finite difference discretization of Poissons equation in two dimensions on a regular square grid of n = k 2 points. (This is also known as the model problem.) If we write the discretized problem as Ax = b , then A is the sparse n-by- n matrix (whose nonzeros are all 4s and- 1s) representing the discretized operator. For this homework, you will not generate or store any of A explicitly. b is an n-vector containing the boundary conditions and any forcing terms. You will write a routine to generate b for debugging, and we will write one for testing and grading. x is an n-vector giving the answer. The CG algorithm is outlined in the course slides for April 7 and April 12, and is described in detail in the references on the course resources page. There is a sequential Matlab code for CG linked to the course web page under Homework 3. You will need to write three routines: DAXPY (which adds a scalar multiple of one dense vector to another, y = y + z ); DDOT (which computes the inner, or dot, product of two dense vectors,...
View Full Document
This note was uploaded on 12/27/2011 for the course CMPSC 240A taught by Professor Gilbert during the Fall '09 term at UCSB.
- Fall '09