Numerical Algorithms.Matrix Multiplication.Gaussian Elimination.Jacobi Iteration.Gauss-Seidel Relaxation.

Slides:



Advertisements
Similar presentations
CSCI-455/552 Introduction to High Performance Computing Lecture 25.
Advertisements

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,
1 5.1 Pipelined Computations. 2 Problem divided into a series of tasks that have to be completed one after the other (the basis of sequential programming).
Faculty of Computer Science © 2006 CMPUT 229 Cache Performance Analysis Hitting for performance.
1 5.1 Pipelined Computations. 2 Problem divided into a series of tasks that have to be completed one after the other (the basis of sequential programming).
CS 484. Dense Matrix Algorithms There are two types of Matrices Dense (Full) Sparse We will consider matrices that are Dense Square.
CSCI-455/552 Introduction to High Performance Computing Lecture 26.
Numerical Algorithms ITCS 4/5145 Parallel Computing UNC-Charlotte, B. Wilkinson, 2009.
Numerical Algorithms Matrix multiplication
CSE5304—Project Proposal Parallel Matrix Multiplication Tian Mi.
Parallel Programming: Techniques and Applications Using Networked Workstations and Parallel Computers Chapter 11: Numerical Algorithms Sec 11.2: Implementing.
Algorithms: Sorting. Rand Sort. Compare-and-exchange. Merge Sort. Quick Sort. Odd-even merge sort. Bitonic merge sort.
Numerical Algorithms • Matrix multiplication
Linear System of Equations MGT 4850 Spring 2008 University of Lethbridge.
Examples of Two- Dimensional Systolic Arrays. Obvious Matrix Multiply Rows of a distributed to each PE in row. Columns of b distributed to each PE in.
Slides for Parallel Programming Techniques & Applications Using Networked Workstations & Parallel Computers 2nd ed., by B. Wilkinson & M
Sparse Matrix Algorithms CS 524 – High-Performance Computing.
CSE621/JKim Lec4.1 9/20/99 CSE621 Parallel Algorithms Lecture 4 Matrix Operation September 20, 1999.
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.
Complexity Analysis (Part I ) Introduction to Algorithms and Complexity Analysis. Motivations for Complexity Analysis. Big-O Notation: An Introduction.
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.
1 Matrix Addition, C = A + B Add corresponding elements of each matrix to form elements of result matrix. Given elements of A as a i,j and elements of.
Matrices Write and Augmented Matrix of a system of Linear Equations Write the system from the augmented matrix Solve Systems of Linear Equations using.
Multivariate Linear Systems and Row Operations.
Exercise problems for students taking the Programming Parallel Computers course. Janusz Kowalik Piotr Arlukowicz Tadeusz Puzniakowski Informatics Institute.
Basic Operations MultiplicationDeterminants Cramer’s RuleIdentityInverses Solving Systems of equations APPENDIX.
AN INTRODUCTION TO ELEMENTARY ROW OPERATIONS Tools to Solve Matrices.
Slide Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
Linear Systems Gaussian Elimination CSE 541 Roger Crawfis.
Three variables Systems of Equations and Inequalities.
Computer Science and Engineering Parallel and Distributed Processing CSE 8380 February 8, 2005 Session 8.
PL/B: A Programming Language for the Blues George Almasi, Luiz DeRose, Jose Moreira, and David Padua.
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.
By: David McQuilling and Jesus Caban Numerical Linear Algebra.
8.1 Matrices & Systems of Equations
Lecture 28: Mathematical Insight and Engineering.
Algebra 3: Section 5.5 Objectives of this Section Find the Sum and Difference of Two Matrices Find Scalar Multiples of a Matrix Find the Product of Two.
Chapter 9 Matrices and Determinants Copyright © 2014, 2010, 2007 Pearson Education, Inc Determinants and Cramer’s Rule.
Slides for Parallel Programming Techniques & Applications Using Networked Workstations & Parallel Computers 2nd ed., by B. Wilkinson & M
Matrices and Systems of Equations
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.
PARALLEL COMPUTATION FOR MATRIX MULTIPLICATION Presented By:Dima Ayash Kelwin Payares Tala Najem.
Finishing up Chapter 5. Will this code enter the if statement? G=[30,55,10] if G
Chapter 5: Matrices and Determinants Section 5.5: Augmented Matrix Solutions.
CSc 8530 Matrix Multiplication and Transpose By Jaman Bhola.
Lecture 9 Numerical Analysis. Solution of Linear System of Equations Chapter 3.
Numerical Algorithms Chapter 11.
The Euclidean Algorithm
CSE 504 Discrete Mathematics & Foundations of Computer Science
CSNB 143 Discrete Mathematical Structures
MATRICES.
Numerical Analysis Lecture12.
Linear Equations.
Introduction to parallel algorithms
Sequences and Summations
Parallel Matrix Operations
Numerical Algorithms • Parallelizing matrix multiplication
Introduction to parallel algorithms
Pipeline Pattern ITCS 4/5145 Parallel Computing, UNC-Charlotte, B. Wilkinson, 2012 slides5.ppt Oct 24, 2013.
Review of Matrix Algebra
Matrix Addition and Multiplication
To accompany the text “Introduction to Parallel Computing”,
Matrix Addition, C = A + B Add corresponding elements of each matrix to form elements of result matrix. Given elements of A as ai,j and elements of B as.
Introduction to parallel algorithms
Applied Discrete Mathematics Week 4: Functions
Presentation transcript:

Numerical Algorithms.Matrix Multiplication.Gaussian Elimination.Jacobi Iteration.Gauss-Seidel Relaxation

Numerical Algorithms Matrix addition

Numerical Algorithms Matrix Multiplication

Numerical Algorithms Matrix-Vector Multiplication

Implementing Matrix Multiplication for(i=0 ; i<n ; i++) for(j=0 ; j<n ; j++){ c[i][j] = 0; for(k=0 ; k<n ; k++) c[i][j] = c[i][j] + a[i][k] * b[k][j]; } Sequential CodeO(n 3 )

Implementing Matrix Multiplication Partitioning into Submatrices for(p=0 ; p<s ; p++) for(q=0 ; q<s ; q++){ Cp,q = 0; for(r=0 ; r<m ; r++) Cp,q = Cp,q + Ap,r * Br,q; }

Implementing Matrix Multiplication

Analysis communication computation

Implementing Matrix Multiplication O(n 2 ) with n 2 processors  O(log n) with n 3 processors

Implementing Matrix Multiplication submatrices s=n/m communication computation

Recursive Implementation mat_mult(App, Bpp, s) { if( s==1) C=A*B; else{ s = s/2; P0 = mat_mult(App, Bpp, s); P1 = mat_mult(Apq, Bqp, s); P2 = mat_mult(App, Bpq, s); P3 = mat_mult(Apq, Bqq, s); P4 = mat_mult(Aqp, Bpp, s); P5 = mat_mult(Aqq, Bqp, s); P6 = mat_mult(Aqp, Bpq, s); P7 = mat_mult(Aqq, Bqq, s); Cpp = P0 + P1; Cpq = P2 + P3; Cqp = P4 + P5; Cqq = P6 + P7; } return(C); }

Mesh Implementation Connon's Algorithm 1. initially processor Pij has element Aij and Bij 2. Elements are moved from their initial position to an "aligned" position. The complete ith row of A is shifted i places left and the complete jth column of B is shifted j places downward. this has the effect of placing the elements aij+1 and the element bi+jj in processor Pij, as illusrated in figure These elements are pair of those required in the accumulation of cij 3. Each processor, P1j, multiplies its elements. 4. The ith row of A is shifted one place right, and the jth column of B is shifted one place downward. this has the effect of bringing together the adjacent elements of A and B, which will also be required in the accumulation, as illustrated in Figure Each processor, Pij, multiplies the elements brought to it and adds the result to the accumulation sum. 6. Step 4 and 5 are repeated until the final result is obtained

Mesh Implementation

Analysis communication computation O(sm 2 )

Two dimensional pipeline--- Systolic array recv(&a, Pi,j-1); recv(&b, Pi-1,j); c=c+a*b; send(&a, Pi,j+1); send(&b, Pi+1,j);

Two dimensional pipeline--- Systolic array

Solving a System of Linear Equations Ax=b Dense matrix Sparse matrix

Solving a System of Linear Equations Gaussian Elimination

Solving a System of Linear Equations for(i=0 ; i<n-1 ; i++) for(j=i+1 ; j<n ; j++){ m = a[j][i]/a[i][i]; for(k=i ; k<n ; k++) a[j][k] = a[j][k] - a[i][k] * m; b[j] = b[j] - b[i] * m; O(n 3 )

Solving a System of Linear Equations communication O(n 2 )

Solving a System of Linear Equations computation

Solving a System of Linear Equations Pipeline configuration

Solving a System of Linear Equations

Iterative Methods Jacobi Iteration

Iterative Methods

Relationship with a General System of Linear Equations Iterative Methods

Gauss-Seidel Relaxation

Iterative Methods

Red-Black Ordering

Iterative Methods forall(i=0 ; i<n ; i++) forall(j=1 ; j<n ; j++) if((i+j)%2 == 0) f[i][j] = 0.25*(f[i-1][j]+f[i][j-1]+f[i+1][j]+f[i][j+1]); forall(i=1 ; i<n ; i++) forall(j=1 ; j<n ; j++) if((i+j)%2 !=0 ) f[i][j] = 0.25*(f[i-1][j]+f[i][j-1]+f[i+1][j]+f[i][j+1]);

Iterative Methods High-Order Difference Methods

Iterative Methods Multigrid Method