1/26 Design of parallel algorithms Linear equations Jari Porras.

Slides:



Advertisements
Similar presentations
Dense Linear Algebra (Data Distributions) Sathish Vadhiyar.
Advertisements

Lecture 19: Parallel Algorithms
Chapter 2 Solutions of Systems of Linear Equations / Matrix Inversion
CSCI-455/552 Introduction to High Performance Computing Lecture 25.
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.
1 Linear Triangular System L – lower triangular matrix, nonsingular Lx=b L: nxn nonsingular lower triangular b: known vector b(1) = b(1)/L(1,1) For i=2:n.
MATH 685/ CSI 700/ OR 682 Lecture Notes
Scientific Computing Linear Systems – Gaussian Elimination.
1 Parallel Algorithms II Topics: matrix and graph algorithms.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Parallel Programming in C with MPI and OpenMP Michael J. Quinn.
Simultaneous Linear Equations
Lecture 7 Intersection of Hyperplanes and Matrix Inverse Shang-Hua Teng.
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
Lecture 6 Matrix Operations and Gaussian Elimination for Solving Linear Systems Shang-Hua Teng.
Solution of linear system of equations
Chapter 9 Gauss Elimination The Islamic University of Gaza
Numerical Algorithms • Matrix multiplication
Linear Algebraic Equations
1 Lecture 25: Parallel Algorithms II Topics: matrix, graph, and sort algorithms Tuesday presentations:  Each group: 10 minutes  Describe the problem,
Design of parallel algorithms
CS 584. Dense Matrix Algorithms There are two types of Matrices Dense (Full) Sparse We will consider matrices that are Dense Square.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 15 Solution of Systems of Equations.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Parallel Programming in C with MPI and OpenMP Michael J. Quinn.
1 Friday, November 03, 2006 “The greatest obstacle to discovery is not ignorance, but the illusion of knowledge.” -D. Boorstin.
Design of parallel algorithms Matrix operations J. Porras.
Dense Matrix Algorithms CS 524 – High-Performance Computing.
Algorithm for Gauss elimination 1) first eliminate for each eq. j, j=1 to n-1 for all eq.s k greater than j a) multiply eq. j by a kj /a jj b) subtract.
Mujahed AlDhaifallah (Term 342) Read Chapter 9 of the textbook
Major: All Engineering Majors Author(s): Autar Kaw
Assignment Solving System of Linear Equations Using MPI Phạm Trần Vũ.
Scientific Computing Linear Systems – LU Factorization.
Square n-by-n Matrix.
MATH 250 Linear Equations and Matrices
CS 584 l Assignment. Systems of Linear Equations l A linear equation in n variables has the form l A set of linear equations is called a system. l A solution.
Dense Linear Algebra Sathish Vadhiyar. Gaussian Elimination - Review Version 1 for each column i zero it out below the diagonal by adding multiples of.
Yasser F. O. Mohammad Assiut University Egypt. Previously in NM Introduction to NM Solving single equation System of Linear Equations Vectors and Matrices.
ΑΡΙΘΜΗΤΙΚΕΣ ΜΕΘΟΔΟΙ ΜΟΝΤΕΛΟΠΟΙΗΣΗΣ 4. Αριθμητική Επίλυση Συστημάτων Γραμμικών Εξισώσεων Gaussian elimination Gauss - Jordan 1.
By: David McQuilling and Jesus Caban Numerical Linear Algebra.
Slides for Parallel Programming Techniques & Applications Using Networked Workstations & Parallel Computers 2nd ed., by B. Wilkinson & M
Lecture 8 Matrix Inverse and LU Decomposition
Lecture 7 - Systems of Equations CVEN 302 June 17, 2002.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 3 - Chapter 9 Linear Systems of Equations: Gauss Elimination.
Chapter 9 Gauss Elimination The Islamic University of Gaza
Dense Linear Algebra Sathish Vadhiyar. Gaussian Elimination - Review Version 1 for each column i zero it out below the diagonal by adding multiples of.
ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign.
Linear Systems Dinesh A.
Lecture 9 Architecture Independent (MPI) Algorithm Design
Unit #1 Linear Systems Fall Dr. Jehad Al Dallal.
Lecture 9 Numerical Analysis. Solution of Linear System of Equations Chapter 3.
1 Numerical Methods Solution of Systems of Linear Equations.
Numerical Algorithms Chapter 11.
Spring Dr. Jehad Al Dallal
Gaussian Elimination.
Linear Equations.
Lecture 22: Parallel Algorithms
Numerical Algorithms • Parallelizing matrix multiplication
CSCE569 Parallel Computing
Parallel Programming in C with MPI and OpenMP
Major: All Engineering Majors Author(s): Autar Kaw
RECORD. RECORD COLLABORATE: Discuss: Is the statement below correct? Try a 2x2 example.
Numerical Analysis Lecture10.
Dense Linear Algebra (Data Distributions)
To accompany the text “Introduction to Parallel Computing”,
Simultaneous Linear Equations Gaussian Elimination with Partial Pivoting
Lecture 8 Matrix Inverse and LU Decomposition
The Gauss Jordan method
Presentation transcript:

1/26 Design of parallel algorithms Linear equations Jari Porras

2/26 Linear equations a 0,0 x a 0,n-1 x n-1 = b 0... a n-1,0 x a n-1,n-1 x n-1 = b n-1 Ax = b Usually solved in 2 stages –reduce into upper triangular system Ux = y –back-substitution x n-1... x 0 Gaussian elimination

3/26 Gaussian elimination

4/26 Gaussian elimination

5/26 Gaussian elimination Gaussian elimination requires –n 2 /2 divisions (line 6) –(n 3 /3) – (n 2 /2) subtractions and multiplications (line 12) Sequential run time 2n 3 /3 How is the gausian elimination peformed in parallel ?

6/26 Parallel Gaussian elimination Row/column striping vs. chackerboarding ? Block vs cyclic striped ? Number of processors p n Active processors ? Required steps ?

7/26

8/26 Analysis 1st step –k th iteration requires n – k – 1 divisions at processor P k 2 nd step –(t s + t w (n – k – 1)) log n time on hypercube 3 rd step –k th iteration requires n – k – 1 multiplications and subtractions at all processors P i Tp = 3/2 n(n-1) + t s nlog n + ½ t w n(n-1)logn

9/26 Analysis Not cost-optimal since pTp =  (n 3 logn) What is the main reason ? –Inefficient parallelization ? –What could be done ?

10/26

11/26

12/26 Analysis Pipelined operation –all n steps are executed in parallel –last step starts in nth step and is completed in constant time (changes only the bottm right corner element) –  (n) steps –Each step takes O(n) time –Thus parallel run time O(n 2 ) and cost (n 3 ) –Cost-optimal !!

13/26 p < n ? Block striping –several rows / processor Does the activity change ? –Block vs. cyclic striping

14/26

15/26

16/26 Analysis With block striping –processor with all rows belonging to the active part performs (n – k – 1)n/p multiplications and subtractions –if the pipelined version is used the number of arithmetic operations (2(n-k-1)n/p) is higher than number of words communicated (n-k-1) –computation dominates –parallel run time n 3 /p

17/26 Checkeboard partitioning Use n x n mesh Same approach as before, but –requires two broadcasts (rowwise and columnwise) –Analyse the cost-optimality How about the pipelining ?

18/26

19/26 Pipelined checkerboard

20/26 Pipelined checkerboard

21/26 p < n 2 Map matrix onto  p x  p mesh by usin block checkerboard partitioning Remember the effect of active processors !! Number of multiplications and subtractions n 2 /p and n/  p word communication –computation dominates !

22/26

23/26

24/26 Partial pivoting Basic algorithm fails if any elemnt on diagonal is zero Partial pivoting helps –select row that has the largest element on the wanted column and exchange rows What is the effect to the partitioning strategy ? How about pipelining

25/26 Back-substitution The second stage of solving linear equations Back-substitution is used to determine vector x Complexity n 2 –use partitioning scheme that is suitable for Gaussian elimination

26/26 Back substitution