Direct and Line Based Iterative Methods for Solving Sparse Block Linear Systems

Total Page:16

File Type:pdf, Size:1020Kb

Direct and Line Based Iterative Methods for Solving Sparse Block Linear Systems Direct and Line Based Iterative Methods for Solving Sparse Block Linear Systems A thesis submitted to the Graduate School of the University of Cincinnati in partial fulfillment of the requirements for the degree of MASTER OF SCIENCE in the Department of Aerospace Engineering and Engineering Mechanics of the College of Engineering and Applied Science by Xiaolin Yang B.S. Shandong University, June 2012 Date: Oct/31/2018 Committee Chair: Mark G. Turner, Sc.D Abstract Solving sparse linear system of equations represents the major computation cost in many scientific and engineering areas. There are two major approaches for solving large sparse linear system: direct method and iterative method. Both methods have their own advantages for certain type of problem. In general, the direct method is more robust and the iterative method has better scalability. High-order Discontinuous Galerkin (DG) Method has gained growing interest in Computation Fluid Dynamics (CFD) community. The Jacobian matrices that arise in the application of the DG method are sparse and block-structured. This thesis summarizes the development of direct and iterative solvers for sparse block linear system. Block capability is achieved by using Intel CPU library or Nvidia GPU based libraries. The direct solver uses left-looking method with fill-reducing ordering to factorize the matrices into lower/upper triangular parts. The iterative solver uses line-based Successive Over-Relaxation method (SLOR) and Alternating Direction Implicit method (ADI), which exploit the characteristic of structured grid. The direct and iterative solvers are tested with matrices from the simulation of a flow channel using DG method. The grid dimension is 6 × 2 × 2 . The results show that direct solver performs better on these small matrices. However, the iterative solver using ADI method demonstrates better scalability with respect to the degree of polynomial used in DG scheme. ii This work advances the development of linear solver for DG method. ii iii Acknowledgement First and foremost, I would like to express my sincere gratitude to my advisor Dr. Mark Turner for his guidance and patience. Dr. Turner and I spent a lot of time on this thesis and the discussion with him always benefits me. I would also like to thank the rest of my committee members, Dr. Shaaban Abdallah and Dr. Donald French, for their time and insightful comments. I am sincerely grateful to Nathan Wukie for providing me the test cases of this thesis. This thesis cannot be done without Nathan’s help. Finally, I would like to thank my parents and Sisi for their support over the years. They have always been there for me during the hard time of my life. iv Contents Abstract ....................................................................................................................... ii Acknowledgement ..................................................................................................... iv Contents ...................................................................................................................... v List of Figures ......................................................................................................... viii Nomenclature ............................................................................................................ xi 1 Introduction ......................................................................................................... 1 Background .................................................................................................... 1 Motivation ...................................................................................................... 2 Sparse Linear Solver Data Structure .............................................................. 3 Overview of Direct Method ........................................................................... 5 1.4.1 Symbolic Analysis .............................................................................. 5 1.4.2 Numerical Factorization...................................................................... 7 1.4.3 Solving Sparse Triangular System ...................................................... 8 Overview of Iterative Method ........................................................................ 8 Linear Algebra Package ............................................................................... 11 1.6.1 Intel Math Kernel Library ................................................................. 11 v 1.6.2 Nvidia cuBLAS and cuSolver ........................................................... 12 Thesis Outline .............................................................................................. 12 2 Direct Methodology ......................................................................................... 13 Overall Algorithm ........................................................................................ 13 Solving Sparse Triangular System ............................................................... 14 Block-wise Left-looking Method ................................................................. 17 Symbolic Analysis and Fill-reducing Ordering ........................................... 19 Error Analysis .............................................................................................. 23 Iterative Refinement..................................................................................... 24 Memory Management .................................................................................. 25 Data Structure .............................................................................................. 25 3 SLOR/SLOR-ADI Methodology..................................................................... 27 Overall Algorithm of SLOR Method ........................................................... 27 Symbolic Analysis of SLOR Method .......................................................... 28 Block-wise Thomas Algorithm .................................................................... 31 Convergence Analysis of SLOR Method ..................................................... 32 SLOR-ADI Method ..................................................................................... 34 Memory Management .................................................................................. 39 Data Structure .............................................................................................. 40 4 Implementation ................................................................................................ 41 Test Case ...................................................................................................... 41 vi Test Configuration ........................................................................................ 43 Direct Method .............................................................................................. 44 SLOR Method .............................................................................................. 51 ADI Method ................................................................................................. 57 GPU Application .......................................................................................... 62 5 Conclusion and Future Work.......................................................................... 65 References ................................................................................................................. 66 vii List of Figures 2.1: Illustration of symbolic analysis process. ....................................................................... 14 2.2: Finding the non-zero pattern of x. .................................................................................. 16 2.3: Row-merge tree of (2.6) .................................................................................................. 21 3.1: Illustration of SLOR method .......................................................................................... 27 3.2: A structured 4×3 2D grid with natural ordering. ............................................................. 28 3.3: Illustration of SLOR-ADI method. ................................................................................. 34 3.4: 3×2×2 structured 3D grid with natural ordering. ............................................................ 35 4.1: 6×2×2 3D structured grid ................................................................................................ 42 4.2: Contours of pressure coefficient. .................................................................................... 42 4.3: Nonzero pattern of Jacobian matrix. ............................................................................... 43 4.4: Nonzero pattern of L+U-I with original ordering. .......................................................... 44 4.5: Nonzero pattern of L+U-I with fill-reducing ordering. .................................................. 45 4.6: Direct method execution time (ms). ............................................................................... 46 4.7: Execution time per equation (ms). .................................................................................. 46 4.8: Log scaled execution time with original ordering. ......................................................... 47 4.9: Log scaled execution time with fill-reducing ordering. .................................................. 47 4.10: Log scaled execution time per equation with original ordering. .................................. 48 4.11:
Recommended publications
  • Solving the Multi-Way Matching Problem by Permutation Synchronization
    Solving the multi-way matching problem by permutation synchronization Deepti Pachauriy Risi Kondorx Vikas Singhy yUniversity of Wisconsin Madison xThe University of Chicago [email protected] [email protected] [email protected] http://pages.cs.wisc.edu/∼pachauri/perm-sync Abstract The problem of matching not just two, but m different sets of objects to each other arises in many contexts, including finding the correspondence between feature points across multiple images in computer vision. At present it is usually solved by matching the sets pairwise, in series. In contrast, we propose a new method, Permutation Synchronization, which finds all the matchings jointly, in one shot, via a relaxation to eigenvector decomposition. The resulting algorithm is both computationally efficient, and, as we demonstrate with theoretical arguments as well as experimental results, much more stable to noise than previous methods. 1 Introduction 0 Finding the correct bijection between two sets of objects X = fx1; x2; : : : ; xng and X = 0 0 0 fx1; x2; : : : ; xng is a fundametal problem in computer science, arising in a wide range of con- texts [1]. In this paper, we consider its generalization to matching not just two, but m different sets X1;X2;:::;Xm. Our primary motivation and running example is the classic problem of matching landmarks (feature points) across many images of the same object in computer vision, which is a key ingredient of image registration [2], recognition [3, 4], stereo [5], shape matching [6, 7], and structure from motion (SFM) [8, 9]. However, our approach is fully general and equally applicable to problems such as matching multiple graphs [10, 11].
    [Show full text]
  • Arxiv:1912.06217V3 [Math.NA] 27 Feb 2021
    ROUNDING ERROR ANALYSIS OF MIXED PRECISION BLOCK HOUSEHOLDER QR ALGORITHMS∗ L. MINAH YANG† , ALYSON FOX‡, AND GEOFFREY SANDERS‡ Abstract. Although mixed precision arithmetic has recently garnered interest for training dense neural networks, many other applications could benefit from the speed-ups and lower storage cost if applied appropriately. The growing interest in employing mixed precision computations motivates the need for rounding error analysis that properly handles behavior from mixed precision arithmetic. We develop mixed precision variants of existing Householder QR algorithms and show error analyses supported by numerical experiments. 1. Introduction. The accuracy of a numerical algorithm depends on several factors, including numerical stability and well-conditionedness of the problem, both of which may be sensitive to rounding errors, the difference between exact and finite precision arithmetic. Low precision floats use fewer bits than high precision floats to represent the real numbers and naturally incur larger rounding errors. Therefore, error attributed to round-off may have a larger influence over the total error and some standard algorithms may yield insufficient accuracy when using low precision storage and arithmetic. However, many applications exist that would benefit from the use of low precision arithmetic and storage that are less sensitive to floating-point round-off error, such as training dense neural networks [20] or clustering or ranking graph algorithms [25]. As a step towards that goal, we investigate the use of mixed precision arithmetic for the QR factorization, a widely used linear algebra routine. Many computing applications today require solutions quickly and often under low size, weight, and power constraints, such as in sensor formation, where low precision computation offers the ability to solve many problems with improvement in all four parameters.
    [Show full text]
  • Arxiv:1709.00765V4 [Cond-Mat.Stat-Mech] 14 Oct 2019
    Number of hidden states needed to physically implement a given conditional distribution Jeremy A. Owen,1 Artemy Kolchinsky,2 and David H. Wolpert2, 3, 4, ∗ 1Physics of Living Systems Group, Department of Physics, Massachusetts Institute of Technology, 400 Tech Square, Cambridge, MA 02139. 2Santa Fe Institute 3Arizona State University 4http://davidwolpert.weebly.com† (Dated: October 15, 2019) We consider the problem of how to construct a physical process over a finite state space X that applies some desired conditional distribution P to initial states to produce final states. This problem arises often in the thermodynamics of computation and nonequilibrium statistical physics more generally (e.g., when designing processes to implement some desired computation, feedback controller, or Maxwell demon). It was previously known that some conditional distributions cannot be implemented using any master equation that involves just the states in X. However, here we show that any conditional distribution P can in fact be implemented—if additional “hidden” states not in X are available. Moreover, we show that is always possible to implement P in a thermodynamically reversible manner. We then investigate a novel cost of the physical resources needed to implement a given distribution P : the minimal number of hidden states needed to do so. We calculate this cost exactly for the special case where P represents a single-valued function, and provide an upper bound for the general case, in terms of the nonnegative rank of P . These results show that having access to one extra binary degree of freedom, thus doubling the total number of states, is sufficient to implement any P with a master equation in a thermodynamically reversible way, if there are no constraints on the allowed form of the master equation.
    [Show full text]
  • On the Asymptotic Existence of Partial Complex Hadamard Matrices And
    Discrete Applied Mathematics 102 (2000) 37–45 View metadata, citation and similar papers at core.ac.uk brought to you by CORE On the asymptotic existence of partial complex Hadamard provided by Elsevier - Publisher Connector matrices and related combinatorial objects Warwick de Launey Center for Communications Research, 4320 Westerra Court, San Diego, California, CA 92121, USA Received 1 September 1998; accepted 30 April 1999 Abstract A proof of an asymptotic form of the original Goldbach conjecture for odd integers was published in 1937. In 1990, a theorem reÿning that result was published. In this paper, we describe some implications of that theorem in combinatorial design theory. In particular, we show that the existence of Paley’s conference matrices implies that for any suciently large integer k there is (at least) about one third of a complex Hadamard matrix of order 2k. This implies that, for any ¿0, the well known bounds for (a) the number of codewords in moderately high distance binary block codes, (b) the number of constraints of two-level orthogonal arrays of strengths 2 and 3 and (c) the number of mutually orthogonal F-squares with certain parameters are asymptotically correct to within a factor of 1 (1 − ) for cases (a) and (b) and to within a 3 factor of 1 (1 − ) for case (c). The methods yield constructive algorithms which are polynomial 9 in the size of the object constructed. An ecient heuristic is described for constructing (for any speciÿed order) about one half of a Hadamard matrix. ? 2000 Elsevier Science B.V. All rights reserved.
    [Show full text]
  • Triangular Factorization
    Chapter 1 Triangular Factorization This chapter deals with the factorization of arbitrary matrices into products of triangular matrices. Since the solution of a linear n n system can be easily obtained once the matrix is factored into the product× of triangular matrices, we will concentrate on the factorization of square matrices. Specifically, we will show that an arbitrary n n matrix A has the factorization P A = LU where P is an n n permutation matrix,× L is an n n unit lower triangular matrix, and U is an n ×n upper triangular matrix. In connection× with this factorization we will discuss pivoting,× i.e., row interchange, strategies. We will also explore circumstances for which A may be factored in the forms A = LU or A = LLT . Our results for a square system will be given for a matrix with real elements but can easily be generalized for complex matrices. The corresponding results for a general m n matrix will be accumulated in Section 1.4. In the general case an arbitrary m× n matrix A has the factorization P A = LU where P is an m m permutation× matrix, L is an m m unit lower triangular matrix, and U is an×m n matrix having row echelon structure.× × 1.1 Permutation matrices and Gauss transformations We begin by defining permutation matrices and examining the effect of premulti- plying or postmultiplying a given matrix by such matrices. We then define Gauss transformations and show how they can be used to introduce zeros into a vector. Definition 1.1 An m m permutation matrix is a matrix whose columns con- sist of a rearrangement of× the m unit vectors e(j), j = 1,...,m, in RI m, i.e., a rearrangement of the columns (or rows) of the m m identity matrix.
    [Show full text]
  • Think Global, Act Local When Estimating a Sparse Precision
    Think Global, Act Local When Estimating a Sparse Precision Matrix by Peter Alexander Lee A.B., Harvard University (2007) Submitted to the Sloan School of Management in partial fulfillment of the requirements for the degree of Master of Science in Operations Research at the MASSACHUSETTS INSTITUTE OF TECHNOLOGY June 2016 ○c Peter Alexander Lee, MMXVI. All rights reserved. The author hereby grants to MIT permission to reproduce and to distribute publicly paper and electronic copies of this thesis document in whole or in part in any medium now known or hereafter created. Author................................................................ Sloan School of Management May 12, 2016 Certified by. Cynthia Rudin Associate Professor Thesis Supervisor Accepted by . Patrick Jaillet Dugald C. Jackson Professor, Department of Electrical Engineering and Computer Science and Co-Director, Operations Research Center 2 Think Global, Act Local When Estimating a Sparse Precision Matrix by Peter Alexander Lee Submitted to the Sloan School of Management on May 12, 2016, in partial fulfillment of the requirements for the degree of Master of Science in Operations Research Abstract Substantial progress has been made in the estimation of sparse high dimensional pre- cision matrices from scant datasets. This is important because precision matrices underpin common tasks such as regression, discriminant analysis, and portfolio opti- mization. However, few good algorithms for this task exist outside the space of L1 penalized optimization approaches like GLASSO. This thesis introduces LGM, a new algorithm for the estimation of sparse high dimensional precision matrices. Using the framework of probabilistic graphical models, the algorithm performs robust covari- ance estimation to generate potentials for small cliques and fuses the local structures to form a sparse yet globally robust model of the entire distribution.
    [Show full text]
  • Fast Singular Value Thresholding Without Singular Value Decomposition∗
    METHODS AND APPLICATIONS OF ANALYSIS. c 2013 International Press Vol. 20, No. 4, pp. 335–352, December 2013 002 FAST SINGULAR VALUE THRESHOLDING WITHOUT SINGULAR VALUE DECOMPOSITION∗ JIAN-FENG CAI† AND STANLEY OSHER‡ Abstract. Singular value thresholding (SVT) is a basic subroutine in many popular numerical schemes for solving nuclear norm minimization that arises from low-rank matrix recovery prob- lems such as matrix completion. The conventional approach for SVT is first to find the singular value decomposition (SVD) and then to shrink the singular values. However, such an approach is time-consuming under some circumstances, especially when the rank of the resulting matrix is not significantly low compared to its dimension. In this paper, we propose a fast algorithm for directly computing SVT for general dense matrices without using SVDs. Our algorithm is based on matrix Newton iteration for matrix functions, and the convergence is theoretically guaranteed. Numerical experiments show that our proposed algorithm is more efficient than the SVD-based approaches for general dense matrices. Key words. Low rank matrix, nuclear norm minimization, matrix Newton iteration. AMS subject classifications. 65F30, 65K99. 1. Introduction. Singular value thresholding (SVT) introduced in [7] is a key subroutine in many popular numerical schemes (e.g. [7, 12, 13, 52, 54, 66]) for solving nuclear norm minimization that arises from low-rank matrix recovery problems such as matrix completion [13–15,60]. Let Y Rm×n be a given matrix, and Y = UΣV T be its singular value decomposition (SVD),∈ where U and V are orthonormal matrices and Σ = diag(σ1, σ2,...,σs) is the diagonal matrix with diagonals being the singular values of Y .
    [Show full text]
  • A Simplex-Type Voronoi Algorithm Based on Short Vector Computations of Copositive Quadratic Forms
    Simons workshop Lattices Geometry, Algorithms and Hardness Berkeley, February 21st 2020 A simplex-type Voronoi algorithm based on short vector computations of copositive quadratic forms Achill Schürmann (Universität Rostock) based on work with Mathieu Dutour Sikirić and Frank Vallentin ( for Q n positive definite ) Perfect Forms 2 S>0 DEF: min(Q)= min Q[x] is the arithmetical minimum • x n 0 2Z \{ } Q is uniquely determined by min(Q) and Q perfect • , n MinQ = x Z : Q[x]=min(Q) { 2 } V(Q)=cone xxt : x MinQ is Voronoi cone of Q • { 2 } (Voronoi cones are full dimensional if and only if Q is perfect!) THM: Voronoi cones give a polyhedral tessellation of n S>0 and there are only finitely many up to GL n ( Z ) -equivalence. Voronoi’s Reduction Theory n t GLn(Z) acts on >0 by Q U QU S 7! Georgy Voronoi (1868 – 1908) Task of a reduction theory is to provide a fundamental domain Voronoi’s algorithm gives a recipe for the construction of a complete list of such polyhedral cones up to GL n ( Z ) -equivalence Ryshkov Polyhedron The set of all positive definite quadratic forms / matrices with arithmeticalRyshkov minimum Polyhedra at least 1 is called Ryshkov polyhedron = Q n : Q[x] 1 for all x Zn 0 R 2 S>0 ≥ 2 \{ } is a locally finite polyhedron • R is a locally finite polyhedron • R Vertices of are perfect forms Vertices of are• perfect R • R 1 n n ↵ (det(Q + ↵Q0)) is strictly concave on • 7! S>0 Voronoi’s algorithm Voronoi’s Algorithm Start with a perfect form Q 1.
    [Show full text]
  • Mata Glossary of Common Terms
    Title stata.com Glossary Description Commonly used terms are defined here. Mata glossary arguments The values a function receives are called the function’s arguments. For instance, in lud(A, L, U), A, L, and U are the arguments. array An array is any indexed object that holds other objects as elements. Vectors are examples of 1- dimensional arrays. Vector v is an array, and v[1] is its first element. Matrices are 2-dimensional arrays. Matrix X is an array, and X[1; 1] is its first element. In theory, one can have 3-dimensional, 4-dimensional, and higher arrays, although Mata does not directly provide them. See[ M-2] Subscripts for more information on arrays in Mata. Arrays are usually indexed by sequential integers, but in associative arrays, the indices are strings that have no natural ordering. Associative arrays can be 1-dimensional, 2-dimensional, or higher. If A were an associative array, then A[\first"] might be one of its elements. See[ M-5] asarray( ) for associative arrays in Mata. binary operator A binary operator is an operator applied to two arguments. In 2-3, the minus sign is a binary operator, as opposed to the minus sign in -9, which is a unary operator. broad type Two matrices are said to be of the same broad type if the elements in each are numeric, are string, or are pointers. Mata provides two numeric types, real and complex. The term broad type is used to mask the distinction within numeric and is often used when discussing operators or functions.
    [Show full text]
  • The Use of the Vec-Permutation Matrix in Spatial Matrix Population Models Christine M
    Ecological Modelling 188 (2005) 15–21 The use of the vec-permutation matrix in spatial matrix population models Christine M. Hunter∗, Hal Caswell Biology Department MS-34, Woods Hole Oceanographic Institution, Woods Hole, MA 02543, USA Abstract Matrix models for a metapopulation can be formulated in two ways: in terms of the stage distribution within each spatial patch, or in terms of the spatial distribution within each stage. In either case, the entries of the projection matrix combine demographic and dispersal information in potentially complicated ways. We show how to construct such models from a simple block-diagonal formulation of the demographic and dispersal processes, using a special permutation matrix called the vec-permutation matrix. This formulation makes it easy to calculate and interpret the sensitivity and elasticity of λ to changes in stage- and patch-specific demographic and dispersal parameters. © 2005 Christine M. Hunter and Hal Caswell. Published by Elsevier B.V. All rights reserved. Keywords: Matrix population model; Spatial model; Metapopulation; Multiregional model; Dispersal; Movement; Sensitivity; Elasticity 1. Introduction If each local population is described by a stage- classified matrix population model (see Caswell, A spatial population model describes a finite set of 2001), a spatial matrix model describing the metapop- discrete local populations coupled by the movement ulation can be written as or dispersal of individuals. Human demographers call these multiregional populations (Rogers, 1968, 1995), n(t + 1) = An(t) (1) ecologists call them multisite populations (Lebreton, 1996) or metapopulations (Hanski, 1999). The dynam- The population vector, n, includes the densities of ics of metapopulations are determined by the patterns each stage in each local population (which we will of dispersal among the local populations and the de- refer to here as a patch).
    [Show full text]
  • Combinatorial Optimization, Packing and Covering
    Combinatorial Optimization: Packing and Covering G´erard Cornu´ejols Carnegie Mellon University July 2000 1 Preface The integer programming models known as set packing and set cov- ering have a wide range of applications, such as pattern recognition, plant location and airline crew scheduling. Sometimes, due to the spe- cial structure of the constraint matrix, the natural linear programming relaxation yields an optimal solution that is integer, thus solving the problem. Sometimes, both the linear programming relaxation and its dual have integer optimal solutions. Under which conditions do such integrality properties hold? This question is of both theoretical and practical interest. Min-max theorems, polyhedral combinatorics and graph theory all come together in this rich area of discrete mathemat- ics. In addition to min-max and polyhedral results, some of the deepest results in this area come in two flavors: “excluded minor” results and “decomposition” results. In these notes, we present several of these beautiful results. Three chapters cover min-max and polyhedral re- sults. The next four cover excluded minor results. In the last three, we present decomposition results. We hope that these notes will encourage research on the many intriguing open questions that still remain. In particular, we state 18 conjectures. For each of these conjectures, we offer $5000 as an incentive for the first correct solution or refutation before December 2020. 2 Contents 1Clutters 7 1.1 MFMC Property and Idealness . 9 1.2 Blocker . 13 1.3 Examples .......................... 15 1.3.1 st-Cuts and st-Paths . 15 1.3.2 Two-Commodity Flows . 17 1.3.3 r-Cuts and r-Arborescences .
    [Show full text]
  • Sparse Precision Matrix Estimation Via Lasso Penalized D-Trace Loss
    Biometrika (2014), 101,1,pp. 103–120 doi: 10.1093/biomet/ast059 Printed in Great Britain Advance Access publication 12 February 2014 Sparse precision matrix estimation via lasso penalized D-trace loss BY TENG ZHANG Department of Mathematics, Princeton University, Fine Hall, Washington Rd, Princeton, Downloaded from New Jersey 08544, U.S.A. [email protected] AND HUI ZOU http://biomet.oxfordjournals.org/ School of Statistics, University of Minnesota, 224 Church St SE, Minneapolis, Minnesota 55455, U.S.A. [email protected] SUMMARY We introduce a constrained empirical loss minimization framework for estimating high- dimensional sparse precision matrices and propose a new loss function, called the D-trace loss, for that purpose. A novel sparse precision matrix estimator is defined as the minimizer of the lasso at University of Minnesota,Walter Library Serial Processing on March 5, 2014 penalized D-trace loss under a positive-definiteness constraint. Under a new irrepresentability condition, the lasso penalized D-trace estimator is shown to have the sparse recovery property. Examples demonstrate that the new condition can hold in situations where the irrepresentability condition for the lasso penalized Gaussian likelihood estimator fails. We establish rates of con- vergence for the new estimator in the elementwise maximum, Frobenius and operator norms. We develop a very efficient algorithm based on alternating direction methods for computing the pro- posed estimator. Simulated and real data are used to demonstrate the computational efficiency of our algorithm and the finite-sample performance of the new estimator. The lasso penalized D-trace estimator is found to compare favourably with the lasso penalized Gaussian likelihood estimator.
    [Show full text]