Parallel Solution of the Poisson Problem Using MPI

Slides:



Advertisements
Similar presentations
Finite Elements Principles and Practices - Fall 03 FE Course Lecture II – Outline UCSD - 10/09/03 1.Review of Last Lecture (I) Formal Definition of FE:
Advertisements

Chapter 8 Elliptic Equation.
Basic FEA Procedures Structural Mechanics Displacement-based Formulations.
P. Venkataraman Mechanical Engineering P. Venkataraman Rochester Institute of Technology DETC2013 – 12269: Continuous Solution for Boundary Value Problems.
MATH 685/ CSI 700/ OR 682 Lecture Notes
Solving Linear Systems (Numerical Recipes, Chap 2)
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Parallel Programming in C with MPI and OpenMP Michael J. Quinn.
Some Ideas Behind Finite Element Analysis
Rayan Alsemmeri Amseena Mansoor. LINEAR SYSTEMS Jacobi method is used to solve linear systems of the form Ax=b, where A is the square and invertible.
Numerical Algorithms Matrix multiplication
Modern iterative methods For basic iterative methods, converge linearly Modern iterative methods, converge faster –Krylov subspace method Steepest descent.
1cs542g-term Notes  Assignment 1 will be out later today (look on the web)
1cs542g-term Notes  Make-up lecture tomorrow 1-2, room 204.
CSCI 317 Mike Heroux1 Sparse Matrix Computations CSCI 317 Mike Heroux.
Sparse Matrix Algorithms CS 524 – High-Performance Computing.
1 Systems of Linear Equations Iterative Methods. 2 B. Iterative Methods 1.Jacobi method and Gauss Seidel 2.Relaxation method for iterative methods.
Avoiding Communication in Sparse Iterative Solvers Erin Carson Nick Knight CS294, Fall 2011.
Finite Element Method in Geotechnical Engineering
Special Matrices and Gauss-Siedel
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.
CS267 L24 Solving PDEs.1 Demmel Sp 1999 CS 267 Applications of Parallel Computers Lecture 24: Solving Linear Systems arising from PDEs - I James Demmel.
Monica Garika Chandana Guduru. METHODS TO SOLVE LINEAR SYSTEMS Direct methods Gaussian elimination method LU method for factorization Simplex method of.
MCE 561 Computational Methods in Solid Mechanics
PETE 603 Lecture Session #29 Thursday, 7/29/ Iterative Solution Methods Older methods, such as PSOR, and LSOR require user supplied iteration.
1 Parallel Simulations of Underground Flow in Porous and Fractured Media H. Mustapha 1,2, A. Beaudoin 1, J. Erhel 1 and J.R. De Dreuzy IRISA – INRIA.
The Finite Element Method
Conjugate gradients, sparse matrix-vector multiplication, graphs, and meshes Thanks to Aydin Buluc, Umit Catalyurek, Alan Edelman, and Kathy Yelick for.
Exercise problems for students taking the Programming Parallel Computers course. Janusz Kowalik Piotr Arlukowicz Tadeusz Puzniakowski Informatics Institute.
© Fluent Inc. 9/5/2015L1 Fluids Review TRN Solution Methods.
Systems of Linear Equations Iterative Methods
An approach for solving the Helmholtz Equation on heterogeneous platforms An approach for solving the Helmholtz Equation on heterogeneous platforms G.
Solving Scalar Linear Systems Iterative approach Lecture 15 MA/CS 471 Fall 2003.
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.
Fast Low-Frequency Impedance Extraction using a Volumetric 3D Integral Formulation A.MAFFUCCI, A. TAMBURRINO, S. VENTRE, F. VILLONE EURATOM/ENEA/CREATE.
Scientific Computing Partial Differential Equations Poisson Equation.
Finite Element Method.
UPC Applications Parry Husbands. Roadmap Benchmark small applications and kernels —SPMV (for iterative linear/eigen solvers) —Multigrid Develop sense.
CS 219: Sparse Matrix Algorithms
1 Variational and Weighted Residual Methods. 2 The Weighted Residual Method The governing equation for 1-D heat conduction A solution to this equation.
Linear Systems Iterative Solutions CSE 541 Roger Crawfis.
Elliptic PDEs and the Finite Difference Method
On the Use of Sparse Direct Solver in a Projection Method for Generalized Eigenvalue Problems Using Numerical Integration Takamitsu Watanabe and Yusaku.
CS240A: Conjugate Gradients and the Model Problem.
HEAT TRANSFER FINITE ELEMENT FORMULATION
Case Study in Computational Science & Engineering - Lecture 5 1 Iterative Solution of Linear Systems Jacobi Method while not converged do { }
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.
Introduction to Scientific Computing II Overview Michael Bader.
Lecture 21 MA471 Fall 03. Recall Jacobi Smoothing We recall that the relaxed Jacobi scheme: Smooths out the highest frequency modes fastest.
ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign.
Discretization for PDEs Chunfang Chen,Danny Thorne Adam Zornes, Deng Li CS 521 Feb., 9,2006.
Chapter 7 Finite element programming May 17, 2011.
Partial Derivatives Example: Find If solution: Partial Derivatives Example: Find If solution: gradient grad(u) = gradient.
MA/CS 471 Lecture 15, Fall 2002 Introduction to Graph Partitioning.
Finite Element Modelling of Photonic Crystals Ben Hiett J Generowicz, M Molinari, D Beckett, KS Thomas, GJ Parker and SJ Cox High Performance Computing.
Monte Carlo Linear Algebra Techniques and Their Parallelization Ashok Srinivasan Computer Science Florida State University
A Parallel Hierarchical Solver for the Poisson Equation Seung Lee Deparment of Mechanical Engineering
CSCI-455/552 Introduction to High Performance Computing Lecture 15.
MA237: Linear Algebra I Chapters 1 and 2: What have we learned?
Conjugate gradient iteration One matrix-vector multiplication per iteration Two vector dot products per iteration Four n-vectors of working storage x 0.
Finite Element Method in Geotechnical Engineering
Solving Linear Systems Ax=b
FEM : Finite Element Method 2017.
© Fluent Inc. 1/10/2018L1 Fluids Review TRN Solution Methods.
Lecture 19 MA471 Fall 2003.
Finite Element Method To be added later 9/18/2018 ELEN 689.
GPU Implementations for Finite Element Methods
CSCE569 Parallel Computing
Matrix Methods Summary
topic4: Implicit method, Stability, ADI method
Presentation transcript:

Parallel Solution of the Poisson Problem Using MPI Jason W. DeGraw Dept. of Mechanical and Nuclear Engineering The Pennsylvania State University

Introduction The Poisson equation equation arises frequently in many areas of mechanical engineering: Heat transfer (Heat conduction with internal heat generation) Solid mechanics (Beam torsion) Fluid mechanics (Potential flow) There are several reasons to use the Poisson equation as a test problem: It is (relatively) easy to solve Many different exact solutions are a available for comparison

A Basic Poisson Problem Our first case is the simple two dimensional Poisson equation on a square: (-1,1) (1,1) x y (-1,-1) (1,-1)

Finite Difference Approach The standard second order difference equation is: This formulation leads to a system of equations that is symmetric banded sparse

Solving the System The system may be solved in many ways: Direct methods (Gaussian elimination) Simple iterative methods (Jacobi, Gauss-Seidel, etc.) Advanced iterative methods (CG, GMRES) We will only consider iterative methods here, as we would like to test ways to solve big problems. We will use Jacobi Gauss-Seidel Conjugate gradient

Jacobi and Gauss-Seidel The Jacobi and Gauss-Seidel iterative methods are easy to understand and easy to implement. Some advantages: No explicit storage of the matrix is required The methods are fairly robust and reliable Some disadvantages Really slow (Gauss-Seidel) REALLY slow (Jacobi) Relaxation methods (which are related) are usually better, but can be less reliable.

The Conjugate Gradient Method CG is a much more powerful way to solve the problem. Some advantages: Easy to program (compared to other advanced methods) Fast (theoretical convergence in N steps for an N by N system) Some disadvantages: Explicit representation of the matrix is probably necessary Applies only to SPD matrices (not an issue here) Note: In this particular case, preconditioning is not an issue. In more general problems, preconditioning must be addressed.

CG (cont’d) As discussed in class, the CG algorithm requires two types of matrix-vector operations: Vector dot product Matrix-vector product The matrix-vector product is more expensive, so we must be careful how we implement it. Also keep in mind that both operations will require communication.

Matrix Storage We could try and take advantage of the banded nature of the system, but a more general solution is the adoption of a sparse matrix storage strategy. Complicated structures are possible, but we will use a very simple one:

Matrix Storage (Cont’d) The previous example is pretty trivial, but consider the following: An N by N grid leads to an N2 by N2 system Each row in the system has no more than 5 nonzero entries Example: N=64 Full storage: 644=16777216 Sparse storage: 642*5*3=61440 “Sparseness” ratio (sparse / full): 0.00366 For large N, storing the full matrix is incredibly wasteful. This form is easy to use in a matrix-vector multiply routine.

Sparse Matrix Multiplication The obligatory chunk of FORTRAN 77 code: c Compute Ax=y do i=1,M y(i)=0.0 do k=1,n(i) y(i)=y(i)+A(i,j(k))*x(j(k)) enddo

Computation Time

Communication Ratio

Speedup

Solution

Limitations of Finite Differences Unfortunately, it is not easy to use finite differences in complex geometries. While it is possible to formulate curvilinear finite difference methods, the resulting equations are usually pretty nasty. The simplicity that makes finite differences attractive in simple geometries disappears in more complicated geometries.

Finite Element Methods The finite element method, while more complicated than finite difference methods, easily extends to complex geometries. A simple (and short) description of the finite element method is not easy to give. Here goes anyway: PDE Weak Form Matrix System

Finite Element Methods (Cont’d) The following steps usually take place Load mesh and boundary conditions Compute element stiffness matrices Assemble global stiffness matrix and right-hand side Solve system of equation Output results Where can we improve things? Steps 1 and 5 are somewhat fixed Step 4 – use parallel solution techniques Avoid step 3 entirely – use an element by element solution technique

An Element by Element Algorithm The assembly process can be considered as a summation: Then: We can compute each element stiffness matrix and store it. Computing the matrix-vector is then done via the above formula.

A Potential Flow Problem A simple test problem for which there is an “exact” solution is potential flow over a wavy wall

A Potential Flow Problem (Cont’d) The exact solution is The computed solution at right is accurate to within 1%

Conclusions CG is a better iterative method than Jacobi or Gauss-Seidel. Implementing a fully parallel finite element scheme is quite difficult. Some issues that were not addressed here: Distributed assembly Better mesh distribution schemes (I.e. fewer broadcasts) Good results were obtained using both FEM and finite difference methods.