V C V L T I 0 C V B 1 V T 0 I. l nk

Similar documents
LU Factorization. LU Decomposition. LU Decomposition. LU Decomposition: Motivation A = LU

1 Multiply Eq. E i by λ 0: (λe i ) (E i ) 2 Multiply Eq. E j by λ and add to Eq. E i : (E i + λe j ) (E i )

Computational Linear Algebra

CS412: Lecture #17. Mridul Aanjaneya. March 19, 2015

LU Factorization. LU factorization is the most common way of solving linear systems! Ax = b LUx = b

Direct Methods for Solving Linear Systems. Matrix Factorization

Scientific Computing

Numerical Methods I: Numerical linear algebra

STAT 309: MATHEMATICAL COMPUTATIONS I FALL 2018 LECTURE 13

Direct Methods for Solving Linear Systems. Simon Fraser University Surrey Campus MACM 316 Spring 2005 Instructor: Ha Le

Pivoting. Reading: GV96 Section 3.4, Stew98 Chapter 3: 1.3

CS513, Spring 2007 Prof. Amos Ron Assignment #5 Solutions Prepared by Houssain Kettani. a mj i,j [2,n] a 11

Numerical Linear Algebra

Program Lecture 2. Numerical Linear Algebra. Gaussian elimination (2) Gaussian elimination. Decompositions, numerical aspects

April 26, Applied mathematics PhD candidate, physics MA UC Berkeley. Lecture 4/26/2013. Jed Duersch. Spd matrices. Cholesky decomposition

Gaussian Elimination and Back Substitution

1.Chapter Objectives

Linear Algebra Section 2.6 : LU Decomposition Section 2.7 : Permutations and transposes Wednesday, February 13th Math 301 Week #4

Solving Dense Linear Systems I

Fast algorithms for hierarchically semiseparable matrices

MATH 3511 Lecture 1. Solving Linear Systems 1

AMS526: Numerical Analysis I (Numerical Linear Algebra)

A Column Pre-ordering Strategy for the Unsymmetric-Pattern Multifrontal Method

7. LU factorization. factor-solve method. LU factorization. solving Ax = b with A nonsingular. the inverse of a nonsingular matrix

. =. a i1 x 1 + a i2 x 2 + a in x n = b i. a 11 a 12 a 1n a 21 a 22 a 1n. i1 a i2 a in

AMS526: Numerical Analysis I (Numerical Linear Algebra)

Partial Left-Looking Structured Multifrontal Factorization & Algorithms for Compressed Sensing. Cinna Julie Wu

Linear Systems of n equations for n unknowns

Sparse Linear Algebra PRACE PLA, Ostrava, Czech Republic

Linear Algebraic Equations

CHAPTER 6. Direct Methods for Solving Linear Systems

ANONSINGULAR tridiagonal linear system of the form

Using Postordering and Static Symbolic Factorization for Parallel Sparse LU

Introduction to Mathematical Programming

2.1 Gaussian Elimination

The System of Linear Equations. Direct Methods. Xiaozhou Li.

Direct and Incomplete Cholesky Factorizations with Static Supernodes

Matrix Factorization and Analysis

Fundamentals of Engineering Analysis (650163)

IMPROVING THE PERFORMANCE OF SPARSE LU MATRIX FACTORIZATION USING A SUPERNODAL ALGORITHM

Gaussian Elimination for Linear Systems

LU Factorization. Marco Chiarandini. DM559 Linear and Integer Programming. Department of Mathematics & Computer Science University of Southern Denmark

Illustration of Gaussian elimination to find LU factorization. A = a 11 a 12 a 13 a 14 a 21 a 22 a 23 a 24 a 31 a 32 a 33 a 34 a 41 a 42 a 43 a 44

Lecture 12 (Tue, Mar 5) Gaussian elimination and LU factorization (II)

Factoring Matrices with a Tree-Structured Sparsity Pattern

Sparse linear solvers

B553 Lecture 5: Matrix Algebra Review

Applied Mathematics 205. Unit II: Numerical Linear Algebra. Lecturer: Dr. David Knezevic

Lecture Note 2: The Gaussian Elimination and LU Decomposition

Numerical Linear Algebra

Exploiting Fill-in and Fill-out in Gaussian-like Elimination Procedures on the Extended Jacobian Matrix

Scientific Computing with Case Studies SIAM Press, Lecture Notes for Unit VII Sparse Matrix

Gaussian Elimination without/with Pivoting and Cholesky Decomposition

5.6. PSEUDOINVERSES 101. A H w.

Solving linear systems (6 lectures)

Roundoff Analysis of Gaussian Elimination

SYMBOLIC AND EXACT STRUCTURE PREDICTION FOR SPARSE GAUSSIAN ELIMINATION WITH PARTIAL PIVOTING

Matrix decompositions

SOLVING SPARSE LINEAR SYSTEMS OF EQUATIONS. Chao Yang Computational Research Division Lawrence Berkeley National Laboratory Berkeley, CA, USA

Scientific Computing: An Introductory Survey

Today s class. Linear Algebraic Equations LU Decomposition. Numerical Methods, Fall 2011 Lecture 8. Prof. Jinbo Bi CSE, UConn

COURSE Numerical methods for solving linear systems. Practical solving of many problems eventually leads to solving linear systems.

Lecture Notes to Accompany. Scientific Computing An Introductory Survey. by Michael T. Heath. Chapter 2. Systems of Linear Equations

Scientific Computing WS 2018/2019. Lecture 9. Jürgen Fuhrmann Lecture 9 Slide 1

A Review of Matrix Analysis

DEN: Linear algebra numerical view (GEM: Gauss elimination method for reducing a full rank matrix to upper-triangular

Numerical Methods I Solving Square Linear Systems: GEM and LU factorization

MODULE 7. where A is an m n real (or complex) matrix. 2) Let K(t, s) be a function of two variables which is continuous on the square [0, 1] [0, 1].

Block-tridiagonal matrices

CS100: DISCRETE STRUCTURES. Lecture 3 Matrices Ch 3 Pages:

Numerical Linear Algebra

BLAS: Basic Linear Algebra Subroutines Analysis of the Matrix-Vector-Product Analysis of Matrix-Matrix Product

Direct solution methods for sparse matrices. p. 1/49

1 Determinants. 1.1 Determinant

Elementary Row Operations on Matrices

Bindel, Fall 2016 Matrix Computations (CS 6210) Notes for

AN EFFICIENT APPROACH FOR MULTIFRONTAL AL- GORITHM TO SOLVE NON-POSITIVE-DEFINITE FI- NITE ELEMENT EQUATIONS IN ELECTROMAGNETIC PROBLEMS

L2-7 Some very stylish matrix decompositions for solving Ax = b 10 Oct 2015

Section 5.6. LU and LDU Factorizations

Lecture 11. Linear systems: Cholesky method. Eigensystems: Terminology. Jacobi transformations QR transformation

A DISTRIBUTED-MEMORY RANDOMIZED STRUCTURED MULTIFRONTAL METHOD FOR SPARSE DIRECT SOLUTIONS

Matrix Algebra & Elementary Matrices

Example: Current in an Electrical Circuit. Solving Linear Systems:Direct Methods. Linear Systems of Equations. Solving Linear Systems: Direct Methods

14.2 QR Factorization with Column Pivoting

Math 471 (Numerical methods) Chapter 3 (second half). System of equations

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University

1.5 Gaussian Elimination With Partial Pivoting.

Computation of the mtx-vec product based on storage scheme on vector CPUs

Matrix Assembly in FEA

Ax = b. Systems of Linear Equations. Lecture Notes to Accompany. Given m n matrix A and m-vector b, find unknown n-vector x satisfying

ENHANCING PERFORMANCE AND ROBUSTNESS OF ILU PRECONDITIONERS BY BLOCKING AND SELECTIVE TRANSPOSITION

5.1 Banded Storage. u = temperature. The five-point difference operator. uh (x, y + h) 2u h (x, y)+u h (x, y h) uh (x + h, y) 2u h (x, y)+u h (x h, y)

Topics. Vectors (column matrices): Vector addition and scalar multiplication The matrix of a linear function y Ax The elements of a matrix A : A ij

Example: 2x y + 3z = 1 5y 6z = 0 x + 4z = 7. Definition: Elementary Row Operations. Example: Type I swap rows 1 and 3

Review Questions REVIEW QUESTIONS 71

arxiv: v1 [cs.na] 20 Jul 2015

AMS 209, Fall 2015 Final Project Type A Numerical Linear Algebra: Gaussian Elimination with Pivoting for Solving Linear Systems

A DISTRIBUTED-MEMORY RANDOMIZED STRUCTURED MULTIFRONTAL METHOD FOR SPARSE DIRECT SOLUTIONS

Linear System of Equations

Dense LU factorization and its error analysis

Transcription:

Multifrontal Method Kailai Xu September 16, 2017 Main observation. Consider the LDL T decomposition of a SPD matrix [ ] [ ] [ ] [ ] B V T L 0 I 0 L T L A = = 1 V T V C V L T I 0 C V B 1 V T, 0 I where B = LL T is the Cholesky factorization of B. The Schur complement update V B 1 V T can be written as j 1 V B 1 V T = (V L T )(L 1 V T ) = k=1 l j,k l j+1,k. l nk [ ] lj,k l j+1,k... l nk. Here j : n represents the index of V L T in the global matrix. Every term in the summation can be seen as the contribution from the k-th column. Frontals Let T [j] denotes the descendants of node j and itself, i.e. nonzero entries in the lower off-diagonal in the symbolic L component of A = LL T and itself. Then we have Ū j = k T [j] {j} l j,k l i1,k. l ir,k [ ] lj,k l i1,k... l ir,k, where j, i 1, i 2,..., i r represents all the possible nonzero patterns for node j and above. 1

Figure 1: Elimination tree. For example, in Figure, if j = 6, we have T [j] = {2, 3, 4, 5, 6}, i 1 = 8, i 2 = 9. The Schur complement, which we call frontal matrix, is a j,j a j,i1... a j,ir a i1,j F j =. 0 + Ūj It is easy to see Ū j = k<j,l jk 0 l j,k l i1,k. l ir,k a ir,j [ lj,k l i1,k... l ir,k] k T [j] {j},l jk =0 0 l i1,k [ 0 li1,k... l ir,k]. It is easy to see that only the first term contributes to the first row/column and therefore, l j,j 0 1 0 l j,j l i1,j... l ir,j l i1,j F j =. I, 0 U j 0 I l ir,j l ir,k where U j = k T [j] l i1,k. l ir,k [ ] l i1,k... l ir,k 2

Frontal Method We use to define an addition by indexes. If R = [ p q u v ] [ ] w x, S = y z where R corresponds to {5, 8} and S corresponds to {5, 9} then we have p + w q x R S = u v 0. y 0 z We can see if c 1, c 2,..., c s are the children of node j in the elimination tree then a jj a ji1... a jir a i1,j F j =. 0 U c 1 U c2... U cs a ir,j We have the following algorithm for sparse Cholesky factorization 3

Algorithm 1 Sparse Cholesky Factorization 1: procedure sparsechol 2: for j = 1, 2,..., n do 3: Let j, i 1,..., i r be the locations of nonzeros in L j. 4: Let c 1,..., c s be the children of j in the elimination tree. 5: Form the matrix Ū = U c 1 U c2... U cs and frontal matrix a jj a ji1... a jir a i1,j F j =. 0 Ū a ir,j 6: Factorize F j into l j,j 0 l i1,j. I l ir,j 1 0 l j,j l i1,j... l ir,j 0 U j 0 I 7: function FindL(A) 8: L tril(a) 0 9: for i = 1, 2,..., n do 10: for j nonzero(l :,i )\{i} do 11: for k nonzero(l :,i )\{i}, k > j do 12: L kj true 13: return L It is without any difficulty that the method can be generalized to any matrix 4

Algorithm 2 Sparse Cholesky Factorization 1: procedure sparsechol 2: for j = 1, 2,..., n do 3: Let j, i 1,..., i r be the locations of nonzeros in L j. 4: Let c 1,..., c s be the children of j in the elimination tree. 5: Form the matrix Ū = U c 1 U c2... U cs and frontal matrix a jj a ji1... a jir a i1,j f j =. 0 Ū a ir,j 6: Factorize F j into 1 0 l i1,j. I l ir,j u j,j u i1,j... u ir,j 0 U j Left-looking, right-looking and multifrontal Recall in LU factorization, after scaling one column, we may apply the addition to the other columns immediately or delay it until we need to use the column. This is called left-looking and right-looking respectively. Multifrontal method is another style of looking, which can be illustrated below. Figure 2: Left-looking, right-looking and multifrontal. General Assembly Tree. We do not have to use elimination tree for the factorization process. Actually, we only need an assembly tree, i.e. for any node j with parent node p, 5

the off-diagonal structure of L j is a subset of the structure of L p and p > j. For example, by defining the parent p of j p = min{i > j off-diagonal structure of L j structure of L i }, we will obtain a valid assembly tree(figure ). Figure 3: Assembly tree. Pivoting and scaling It is important to do pivoting and scaling for numerical accuracy reasons. As indicated in[1], the relative forward error is bounded by the condition number of the linear system, multiplied by the backward-error. an ill-posed problem: the backward error can be small even if the solution is far from the exact solution; in that case, the condition number of the system is large; an unstable algorithm, leading to a large backward error compared to the machine precision, even when the condition number of the linear system is small. They can be measured by Backward error err = min{ε > 0 such that A ε A, b ε b }, (A + A) x = b + b} = A x b A x + b 6

condition number A 1 A x + A 1 b x The mathematical formula for pivoting and scaling is(note scaling matrix and permutation matrix are communicable) P D r AD c QDc 1 x = P D r b Doing scaling on a row i is equivalent to doing the corresponding scaling on all the l ij components for j T [i] {i}, and scaling on a ij on all the j Adj G (i). Doing scaling on a column i is equivalent to doing the corresponding scaling on all the u ji components for j T [i] {i}, and scaling on a ji on all the j Adj G (i). As for pivoting, we have limited choice as pivoting may deconstruct the elimination trees. The rule here is to only pivot inside the blocks that are already summed. This requires us to add the contribution of child blocks to parents immediately after factorization instead of the left-looking way. Figure 4: Pivoting on a tree. Node 7 and node 8 have already been summed as the contributions from 1 and 6 have been added. Now if we want to factorize 7, we can do the pivot 8 7. This is the same as interchange node 7 and 8. Supernodal To take advantage of higher BLAS level operations, the use of supernodes is preferred. Supernode is defined as[2] 7

A supernode is a maximal set of contiguous nodes such that Adj G (T [j]) = {j, j + 1,..., j + t} Adj G (T [j + t]) It follows from this definition that in a supernode {j, j + 1,..., j + t}, for 1 k t the node j + k is the parent of j + k 1 in the elimination tree. Here Adj G (T [j]) gives the subscript set of nonzeros in column L j. A supernode corresponds to a maximal block of contiguous columns in the Cholesky factor, where the corresponding diagonal block is full triangular, and these columns all have identical off-block-diagonal column structure. Solve Procedure Given a right hand side, we have the following solving algorithm Algorithm 3 Forward Elimination 1: function Forward_Elimination(b) 2: for i = 1, 2,..., n do Working on front i 3: Solve l ii y i = b i 4: for k > i, l ki 0 do 5: b k b k l ki y i Algorithm 4 Backward Substitution. It is important to use right-looking method to do backward substitution. In every step, we first add the contributions from the successors, i.e. Adj G ( ). 1: function Backward_Substituion(y) 2: for i = n, n 1,..., 1 do 3: for k > i, u ik 0 do For SPD, u ik = l ki 4: y i y i u ik x k 5: Solve u ii x i = y i Programming considerations On the programming aspect, the data should not live in the graph itself. Instead, it should be stored in a separate data structure. For example, in the example above, the data can be stored in a map which takes (self-)edges as keys. The following result illustrates the application of multifrontal method to random matrices without pivoting. 8

10 3 10 2 Factorization Solve 10 1 time(s) 10 0 10-1 10-2 10 1 10 2 10 3 10 4 10 5 N As the matrix is random, the fill-in will be terrible and therefore the complexity will be like O(N 2 ) for the solving step, which is present in the last figure. References [1] Jean-Yves L Excellent. Multifrontal Methods: Parallelism, Memory Usage and Numerical Aspects. PhD thesis, Ecole normale supérieure de lyon-ens LYON, 2012. [2] Joseph WH Liu. The multifrontal method for sparse matrix solution: Theory and practice. SIAM review, 34(1):82 109, 1992. 9