Administrivia: October 5, 2009 Homework 1 due Wednesday Reading in Davis: Skim section 6.1 (the fill bounds will make more sense next week) Read section.

Slides:



Advertisements
Similar presentations
Fill Reduction Algorithm Using Diagonal Markowitz Scheme with Local Symmetrization Patrick Amestoy ENSEEIHT-IRIT, France Xiaoye S. Li Esmond Ng Lawrence.
Advertisements

CS 240A: Solving Ax = b in parallel Dense A: Gaussian elimination with partial pivoting (LU) Same flavor as matrix * matrix, but more complicated Sparse.
© 2006 Pearson Addison-Wesley. All rights reserved14 A-1 Chapter 14 excerpts Graphs (breadth-first-search)
MATH 685/ CSI 700/ OR 682 Lecture Notes
Sparse Matrices in Matlab John R. Gilbert Xerox Palo Alto Research Center with Cleve Moler (MathWorks) and Rob Schreiber (HP Labs)
SOLVING SYSTEMS OF LINEAR EQUATIONS. Overview A matrix consists of a rectangular array of elements represented by a single symbol (example: [A]). An individual.
Lecture 11 - LU Decomposition
1cs542g-term Notes  Assignment 1 will be out later today (look on the web)
Determinants (10/18/04) We learned previously the determinant of the 2 by 2 matrix A = is the number a d – b c. We need now to learn how to compute the.
1cs542g-term Notes  Assignment 1 is out (questions?)
1cs542g-term Notes  Assignment 1 is out (due October 5)  Matrix storage: usually column-major.
Part 3 Chapter 10 LU Factorization PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The McGraw-Hill Companies,
1cs542g-term Sparse matrix data structure  Typically either Compressed Sparse Row (CSR) or Compressed Sparse Column (CSC) Informally “ia-ja” format.
1 An Interactive Environment for Combinatorial Supercomputing John R. Gilbert University of California, Santa Barbara Viral Shah (UCSB) Steve Reinhardt.
CS 290H: Sparse Matrix Algorithms
Sparse Matrix Methods Day 1: Overview Day 2: Direct methods
The Landscape of Ax=b Solvers Direct A = LU Iterative y’ = Ay Non- symmetric Symmetric positive definite More RobustLess Storage (if sparse) More Robust.
CS 240A: Solving Ax = b in parallel °Dense A: Gaussian elimination with partial pivoting Same flavor as matrix * matrix, but more complicated °Sparse A:
Sparse Matrix Methods Day 1: Overview Day 2: Direct methods Nonsymmetric systems Graph theoretic tools Sparse LU with partial pivoting Supernodal factorization.
Sparse Matrix Methods Day 1: Overview Matlab and examples Data structures Ax=b Sparse matrices and graphs Fill-reducing matrix permutations Matching and.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Parallel Programming in C with MPI and OpenMP Michael J. Quinn.
CS240A: Conjugate Gradients and the Model Problem.
The Evolution of a Sparse Partial Pivoting Algorithm John R. Gilbert with: Tim Davis, Jim Demmel, Stan Eisenstat, Laura Grigori, Stefan Larimore, Sherry.
1 Systems of Linear Equations Gauss-Jordan Elimination and LU Decomposition.
CSC 2300 Data Structures & Algorithms March 30, 2007 Chapter 9. Graph Algorithms.
CS 290H Lecture 17 Dulmage-Mendelsohn Theory
Assignment Solving System of Linear Equations Using MPI Phạm Trần Vũ.
Conjugate gradients, sparse matrix-vector multiplication, graphs, and meshes Thanks to Aydin Buluc, Umit Catalyurek, Alan Edelman, and Kathy Yelick for.
CS 290H Lecture 12 Column intersection graphs, Ordering for sparsity in LU with partial pivoting Read “Computing the block triangular form of a sparse.
Scientific Computing Linear Systems – LU Factorization.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Symbolic sparse Gaussian elimination: A = LU
The Landscape of Sparse Ax=b Solvers Direct A = LU Iterative y’ = Ay Non- symmetric Symmetric positive definite More RobustLess Storage More Robust More.
A.Abhari CPS1251 Multidimensional Arrays Multidimensional array is the array with two or more dimensions. For example: char box [3] [3] defines a two-dimensional.
Yasser F. O. Mohammad Assiut University Egypt. Previously in NM Introduction to NM Solving single equation System of Linear Equations Vectors and Matrices.
CS 290H Lecture 5 Elimination trees Read GLN section 6.6 (next time I’ll assign 6.5 and 6.7) Homework 1 due Thursday 14 Oct by 3pm turnin file1.
CS 219: Sparse Matrix Algorithms
 6.2 Pivoting Strategies 1/17 Chapter 6 Direct Methods for Solving Linear Systems -- Pivoting Strategies Example: Solve the linear system using 4-digit.
MA/CS 375 Fall MA/CS 375 Fall 2002 Lecture 21.
1 Incorporating Iterative Refinement with Sparse Cholesky April 2007 Doron Pearl.
Graphs. Definitions A graph is two sets. A graph is two sets. –A set of nodes or vertices V –A set of edges E Edges connect nodes. Edges connect nodes.
Lecture 4 Sparse Factorization: Data-flow Organization
CS240A: Conjugate Gradients and the Model Problem.
Department of Electronic Engineering, Tsinghua University Nano-scale Integrated Circuit and System Lab. Performance Analysis of Parallel Sparse LU Factorization.
ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign.
CS 290H Administrivia: May 14, 2008 Course project progress reports due next Wed 21 May. Reading in Saad (second edition): Sections
CS 290H Lecture 15 GESP concluded Final presentations for survey projects next Tue and Thu 20-minute talk with at least 5 min for questions and discussion.
Linear Systems Dinesh A.
Programming Massively Parallel Graphics Multiprocessors using CUDA Final Project Amirhassan Asgari Kamiabad
CS 290H Lecture 9 Left-looking LU with partial pivoting Read “A supernodal approach to sparse partial pivoting” (course reader #4), sections 1 through.
Symmetric-pattern multifrontal factorization T(A) G(A)
Conjugate gradient iteration One matrix-vector multiplication per iteration Two vector dot products per iteration Four n-vectors of working storage x 0.
Numerical Computation Lecture 6: Linear Systems – part II United International College.
The Landscape of Sparse Ax=b Solvers Direct A = LU Iterative y’ = Ay Non- symmetric Symmetric positive definite More RobustLess Storage More Robust More.
Parallel Direct Methods for Sparse Linear Systems
Model Problem: Solving Poisson’s equation for temperature
CS 290N / 219: Sparse Matrix Algorithms
Linear Equations.
CS 290H Administrivia: April 16, 2008
The Landscape of Sparse Ax=b Solvers
CSCE569 Parallel Computing
Programming #4 Computer Problems
CS 290H Lecture 3 Fill: bounds and heuristics
Part 3 Chapter 10 LU Factorization
Numerical Analysis Lecture10.
Read GLN sections 6.1 through 6.4.
Lecture 8 Matrix Inverse and LU Decomposition
Linear Systems of Equations: solution and applications
Nonsymmetric Gaussian elimination
Ax = b Methods for Solution of the System of Equations:
Presentation transcript:

Administrivia: October 5, 2009 Homework 1 due Wednesday Reading in Davis: Skim section 6.1 (the fill bounds will make more sense next week) Read section 6.2, and chapter 4 through 4.3 A few copies of Davis are available (at a discount) from Roxanne in HFH 5102.

Compressed Sparse Matrix Storage Full storage: 2-dimensional array. (nrows*ncols) memory Sparse storage: Compressed storage by columns (CSC). Three 1-dimensional arrays. (2*nzs + ncols + 1) memory. Similarly, CSR value: row: colstart:

Matrix – Matrix Multiplication: C = A * B C(:, :) = 0; for i = 1:n for j = 1:n for k = 1:n C(i, j) = C(i, j) + A(i, k) * B(k, j); The n 3 scalar updates can be done in any order. Six possible algorithms: ijk, ikj, jik, jki, kij, kji (lots more if you think about blocking for cache). Goal is O(nonzero flops) time for sparse A, B, C. Even time = O(n 2 ) is too slow!

CSC Sparse Matrix Multiplication with SPA CSC Sparse Matrix Multiplication with SPA B = x C A for j = 1:n C(:, j) = A * B(:, j) SPA gather scatter/ accumulate All matrix columns and vectors are stored compressed except the SPA.

The Landscape of Sparse Ax=b Solvers Direct A = LU Iterative y’ = Ay Non- symmetric Symmetric positive definite More RobustLess Storage More Robust More General D

Ax = b: Gaussian elimination (without pivoting) 1.Factor A = LU 2.Solve Ly = b for y 3.Solve Ux = y for x Variations: Pivoting for numerical stability: PA=LU Cholesky for symmetric positive definite A: A = LL T Permuting A to make the factors sparser = x

Triangular solve: x = L \ b Row oriented: for i = 1 : n x(i) = b(i); for j = 1 : (i-1) x(i) = x(i) – L(i, j) * x(j); end; x(i) = x(i) / L(i, i); end; Column oriented: x(1:n) = b(1:n); for j = 1 : n x(j) = x(j) / L(j, j); x(j+1:n) = x(j+1:n) – L(j+1:n, j) * x(j); end; Either way works in O(nnz(L)) time [details for rows: exercise] If b and x are dense, flops = nnz(L) so no problem If b and x are sparse, how do it in O(flops) time?

Directed Graph A is square, unsymmetric, nonzero diagonal Edges from rows to columns Symmetric permutations PAP T AG(A)

Directed Acyclic Graph If A is triangular, G(A) has no cycles Lower triangular => edges from higher to lower #s Upper triangular => edges from lower to higher #s AG(A)

Directed Acyclic Graph If A is triangular, G(A) has no cycles Lower triangular => edges from higher to lower #s Upper triangular => edges from lower to higher #s AG(A)

Depth-first search and postorder dfs (starting vertices) marked(1 : n) = false; p = 1; for each starting vertex v do visit(v); visit (v) if marked(v) then return; marked(v) = true; for each edge (v, w) do visit(w); postorder(v) = p; p = p + 1; When G is acyclic, postorder(v) > postorder(w) for every edge (v, w)

Depth-first search and postorder dfs (starting vertices) marked(1 : n) = false; p = 1; for each starting vertex v do if not marked(v) then visit(v); visit (v) marked(v) = true; for each edge (v, w) do if not marked(w) then visit(w); postorder(v) = p; p = p + 1; When G is acyclic, postorder(v) > postorder(w) for every edge (v, w)

Sparse Triangular Solve = G(L T ) Lxb 1.Symbolic: –Predict structure of x by depth-first search from nonzeros of b 2.Numeric: –Compute values of x in topological order Time = O(flops)

Sparse-sparse triangular solve: x = L \ b Column oriented: dfs in G(L T ) to predict nonzeros of x; x(1:n) = b(1:n); for j = nonzero indices of x in topological order x(j) = x(j) / L(j, j); x(j+1:n) = x(j+1:n) – L(j+1:n, j) * x(j); end; Depth-first search calls “visit” once per flop Runs in O(flops) time even if it’s less than nnz(L) or n … Except for one-time O(n) SPA setup

Nonsymmetric Ax = b: Gaussian elimination (without pivoting) 1.Factor A = LU 2.Solve Ly = b for y 3.Solve Ux = y for x Variations: Pivoting for numerical stability: PA=LU Cholesky for symmetric positive definite A: A = LL T Permuting A to make the factors sparser = x

Left-looking Column LU Factorization for column j = 1 to n do solve scale: l j = l j / u jj Column j of A becomes column j of L and U L 0 L I ( ) ujljujlj = a j for u j, l j L L U A j

Left-looking sparse LU without pivoting (simple) L = speye(n); for column j = 1 : n dfs in G(L T ) to predict nonzeros of x; x(1:n) = A(1:n, j); // x is a SPA for i = nonzero indices of x in topological order x(i) = x(i) / L(i, i); x(i+1:n) = x(i+1:n) – L(i+1:n, i) * x(i); U(1:j, j) = x(1:j); L(j+1:n, j) = x(j+1:n); cdiv: L(j+1:n, j) = L(j+1:n, j) / U(j, j);