Parallelizing Gauss-Seidel Solver/Pre-conditioner Aim: To parallelize a Gauss-Seidel Solver, which can be used as a pre-conditioner for the finite element.

Slides:



Advertisements
Similar presentations
Method If an nxn matrix A has an LU-factorization, then the solution of AX = b can be determined by a Forward substitution followed by a Back substitution.
Advertisements

Parallel Jacobi Algorithm Steven Dong Applied Mathematics.
Dense Matrix Algorithms. Topic Overview Matrix-Vector Multiplication Matrix-Matrix Multiplication Solving a System of Linear Equations.
Parallel Matrix Operations using MPI CPS 5401 Fall 2014 Shirley Moore, Instructor November 3,
CS 484. Dense Matrix Algorithms There are two types of Matrices Dense (Full) Sparse We will consider matrices that are Dense Square.
Numerical Algorithms ITCS 4/5145 Parallel Computing UNC-Charlotte, B. Wilkinson, 2009.
MATH 685/ CSI 700/ OR 682 Lecture Notes
1 Parallel Algorithms II Topics: matrix and graph algorithms.
Linear Systems of Equations
Some Ideas Behind Finite Element Analysis
Autar Kaw Benjamin Rigsby Transforming Numerical Methods Education for STEM Undergraduates.
SOLVING SYSTEMS OF LINEAR EQUATIONS. Overview A matrix consists of a rectangular array of elements represented by a single symbol (example: [A]). An individual.
CISE301_Topic3KFUPM1 SE301: Numerical Methods Topic 3: Solution of Systems of Linear Equations Lectures 12-17: KFUPM Read Chapter 9 of the textbook.
Numerical Algorithms Matrix multiplication
Solution of linear system of equations
Numerical Algorithms • Matrix multiplication
Special Matrices and Gauss-Siedel
Slides for Parallel Programming Techniques & Applications Using Networked Workstations & Parallel Computers 2nd ed., by B. Wilkinson & M
1 Systems of Linear Equations Iterative Methods. 2 B. Iterative Methods 1.Jacobi method and Gauss Seidel 2.Relaxation method for iterative methods.
MECH300H Introduction to Finite Element Methods Lecture 2 Review.
Finite Element Method in Geotechnical Engineering
Special Matrices and Gauss-Siedel
CS 584. Dense Matrix Algorithms There are two types of Matrices Dense (Full) Sparse We will consider matrices that are Dense Square.
1/26 Design of parallel algorithms Linear equations Jari Porras.
Topic Overview One-to-All Broadcast and All-to-One Reduction
Design of parallel algorithms Matrix operations J. Porras.
Thomas algorithm to solve tridiagonal matrices
Dense Matrix Algorithms CS 524 – High-Performance Computing.
Mujahed AlDhaifallah (Term 342) Read Chapter 9 of the textbook
Solving Scalar Linear Systems Iterative approach Lecture 15 MA/CS 471 Fall 2003.
1 Convection Boundary Condition –Happens when a structure is surrounded by fluid –Does not exist in structural problems –BC includes unknown temperature.
1 Iterative Solution Methods Starts with an initial approximation for the solution vector (x 0 ) At each iteration updates the x vector by using the sytem.
Finite Element Method.
CADD: Component-Averaged Domain Decomposition Dan Gordon Computer Science University of Haifa Rachel Gordon Aerospace Engg. Technion January 13,
Chapter 3 Solution of Algebraic Equations 1 ChE 401: Computational Techniques for Chemical Engineers Fall 2009/2010 DRAFT SLIDES.
Eng Ship Structures 1 Matrix Analysis Using MATLAB Example.
Vectors and Matrices In MATLAB a vector can be defined as row vector or as a column vector. A vector of length n can be visualized as matrix of size 1xn.
Slides for Parallel Programming Techniques & Applications Using Networked Workstations & Parallel Computers 2nd ed., by B. Wilkinson & M
Structure of global stiffness matrix Global stiffness matrix K is completed by additions from element matrices, as described in detail in the illustrative.
Lecture 8 Matrix Inverse and LU Decomposition
Elliptic PDEs and the Finite Difference Method
11/11/20151 Trusses. 11/11/20152 Element Formulation by Virtual Work u Use virtual work to derive element stiffness matrix based on assumed displacements.
Illustration of FE algorithm on the example of 1D problem Problem: Stress and displacement analysis of a one-dimensional bar, loaded only by its own weight,
Parallel Solution of the Poisson Problem Using MPI
HEAT TRANSFER FINITE ELEMENT FORMULATION
Linear Systems – Iterative methods
Case Study in Computational Science & Engineering - Lecture 5 1 Iterative Solution of Linear Systems Jacobi Method while not converged do { }
October 2008 Integrated Predictive Simulation System for Earthquake and Tsunami Disaster CREST/Japan Science and Technology Agency (JST)
CS 484. Iterative Methods n Gaussian elimination is considered to be a direct method to solve a system. n An indirect method produces a sequence of values.
ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign.
CHAP 3 WEIGHTED RESIDUAL AND ENERGY METHOD FOR 1D PROBLEMS
Variational and Weighted Residual Methods
Memory-Aware Scheduling for LU in Charm++ Isaac Dooley, Chao Mei, Jonathan Lifflander, Laxmikant V. Kale.
Chapter 7 Finite element programming May 17, 2011.
A Parallel Hierarchical Solver for the Poisson Equation Seung Lee Deparment of Mechanical Engineering
CSCI-455/552 Introduction to High Performance Computing Lecture 15.
X1X1 X2X2  Basic Kinematics Real Applications Simple Shear Trivial geometry Proscribed homogenous deformations Linear constitutive.
FINITE DIFFERENCE In numerical analysis, two different approaches are commonly used: The finite difference and the finite element methods. In heat transfer.
Algor, the commercial FEM package, an introduction Group: 3 Ian Fulton Timothy Chin James Bernstein Hussain Khersoh.
LU Decomposition ● In Gauss elimination; Forward elimination Backward substitution Major computational effort Low computational effort can be used for.
Numerical Algorithms Chapter 11.
Finite Element Method in Geotechnical Engineering
Parallel Matrix Operations
GENERAL VIEW OF KRATOS MULTIPHYSICS
Programming #4 Computer Problems
Numerical Analysis Lecture14.
Numerical Computation and Optimization
Linear Systems Numerical Methods.
To accompany the text “Introduction to Parallel Computing”,
Lecture 8 Matrix Inverse and LU Decomposition
Presentation transcript:

Parallelizing Gauss-Seidel Solver/Pre-conditioner Aim: To parallelize a Gauss-Seidel Solver, which can be used as a pre-conditioner for the finite element code poicyc.cpp Parallelizing a GS solver involves two steps: 1.Re-arrange the stiffness matrix to permit a parallel solution 2.Solve the re-arranged stiffness matrix on multiple CPUs After parallelizing: A. Interface the above with poicyc.cpp to solve large finite element problems on multiple CPUs B. The Gauss-Seidel solver can be extended to SOR solver with the inclusion of factor omega and interpolating with previous vector

Part 1: Re-ordering the Stiffness Matrix Why: The stiffness matrix needs to be re-ordered such that its main diagonal comprises of diagonal sub-matrices. This is achieved by re-numbering the nodes using a ‘coloring scheme’. The new re- numbered mesh will have the structure on the right. Stiffness Matrix Before Re-ordering Stiffness Matrix After Two-color Re-ordering

Node Coloring and Re-ordering General Procedure: For each node in the mesh connectivity, search for all its neighbours. This includes all nodes in all the elements that this node is connected to. Assign a color (i.e. a numerical label) to each node one by one, with the condition that a node cannot have the same color as any of its neighbouring nodes. Structure of the Code: For each node, check neighbours, and store all those nodes For each node, assign color ‘0’. Then assign the smallest numerical label that its neighbours does not have. Collect all nodes of a color, and number them in numerically increasing order. Do the same for all nodes of all colors. Re-order the element connectivity based on the new numbering scheme. Create new vectors for ‘p’ (coordinate data) and ‘t’ (connectivity).

Images of the Mesh and Stiffness Matrices after Re-ordering FE mesh of the cube (uses 10-node tetrahedrons) Nodal coloring of a 2-D 6-node Triangular mesh

Stiffness Matrix After Re-ordering (for the cubic mesh in previous slide) FE mesh of the cube (uses 10-node tetrahedrons) Note multiple Diagonal ‘sub-matrices’ along main Diagonal-one for each color 13 Colors required above

Stiffness Matrix After Re-ordering for a 25,000/Half-million node mesh

Solving the New Stiffness Matrix by Gauss-Seidel Gauss-Seidel Solution for: Ax=B 1.Start with a trial vector x 1 (=B) Compute: B_new = B - U x 1 2. Solve: [D + L] = B_new 3. Update x & repeat Steps 1 through 3 With re-ordered matrix, we have a parallel solution: 1.All rows in step 1 can be solve simultaneously (parallel) 2.Forward substitution can be parallelized thus: 1.Solve D_1 = x _UPPER HALF (simple division: x(i)= b(i)/a(i) ) 2.Compute y = B_new –L x _UPPER HALF 3.Solve x_2 = D_2 /y 3.For multiple colors, do step 1, then repeat steps 2 and 3 for each color U L D_1 D_2

Parallelizing the GS code (on two processes) Step 1 Cyclically, submit each row to a process to Compute RHS – U*x Gather all rows, assemble B-new and broadcast to All procs. About half the rows are Computed by process 1 Send Computed Rows to Proc. 0 Step 2: Compute solution To diagonal elements of Each sub-matrix (on proc. 0) Step 3: Cyclically submit Each row to a process and Compute: y = B-Lx x= y/d Gather all rows, assemble B-new and broadcast to All procs. About half the rows are Computed by process 1 Send Computed x to Proc. 0 Iterate among These steps B/Cast B-new For all colors B/Cast x

Run-Times on various processors 25,000 node model 500,000 node model For 300 iterations 1 p2 p4 p 27.2 s50.7 s 9.2 s 9m 48 s19m 33s Node coloring: 2-3 s 17 s