SlideShare a Scribd company logo
1 of 26
J.M.H.M Jayamaha
SEU/IS/10/PS/104
PS0372
 What is Parallel Algorithm
 What is Linear Algebra
 Dense Matrix Algorithms
◦ Matrix-Vector Multiplication
 Solving a System of Linear Equations
◦ A Simple Gaussian Elimination Algorithm
 Parallel Implementation with 1-D Partitioning
 In computer science, a parallel algorithm, as
opposed to a traditional serial algorithm, is
an algorithm which can be executed a piece
at a time on many different processing
devices, and then combined together again at
the end to get the correct result.
(wikipedia.org)
 Linear algebra is the branch of mathematics
concerning vector spaces and linear
mappings between such spaces. It includes
the study of lines, planes, and subspaces, but
is also concerned with properties common to
all vector spaces.
 dense or full matrices that have no or few
known usable zero entries.
 In numerical analysis, a sparse matrix is
a matrix in which most of the elements are
zero
 This slide addresses the problem of multiplying a dense
n x n matrix A with an n x 1 vector x to yield the n x 1
result vector y.
 serial algorithm for this problem
◦ 1. procedure MAT_VECT ( A, x, y)
◦ 2. begin
◦ 3. for i := 0 to n - 1 do
◦ 4. begin
◦ 5. y[i]:=0;
◦ 6. for j := 0 to n - 1 do
◦ 7. y[i] := y[i] + A[i, j] x x[j];
◦ 8. endfor;
◦ 9. end MAT_VECT
 The sequential algorithm requires n2
multiplications and additions. Assuming that a
multiplication and addition pair takes unit time, the
sequential run time is
W = n2
 At least three distinct parallel formulations of
matrix-vector multiplication are possible,
depending on whether rowwise 1-D, columnwise
1-D, or a 2-D partitioning is used.
 This slide details the parallel algorithm for matrix-
vector multiplication using rowwise block 1-D
partitioning. The parallel algorithm for columnwise
block 1-D partitioning is similar and has a similar
expression for parallel run time
 Next Figure shows the Multiplication of an n x n
matrix with an n x 1 vector using rowwise block 1-
D partitioning. For the one-row-per-process case,
p = n
 First, consider the case in which the n x n matrix is
partitioned among n processes so that each process
stores one complete row of the matrix.
 Figure (a) Process Pi initially owns x[i] and A[i, 0], A[i, 1],
..., A[i, n-1] and is responsible for computing y[i].
 Vector x is multiplied with each row of the matrix
(Algorithm); hence, every process needs the entire
vector.
 Since each process starts with only one element of x, an
all-to-all broadcast is required to distribute all the
elements to all the processes
 This section discusses the problem of solving a system
of linear equations of the form
 In matrix notation, this system is written as Ax = b
 Here A is a dense n x n matrix of coefficients such that
A [i , j ] = ai , j , b is an n x 1 vector [b 0 , b 1 , ..., bn -1 ]T
,and x is the desired solution vector [x 0 , x 1 , ..., xn -1 ]T
 A system of equations Ax = b is usually solved in two
stages. First, through a series of algebraic
manipulations, the original system of equations is
reduced to an upper-triangular system of the form
 We write this as Ux = y , where U is a unit upper-
triangular matrix – one in which all sub diagonal entries
are zero and all principal diagonal entries are equal to
one.
 A serial Gaussian elimination algorithm that converts
the system of linear equations Ax = b to a unit upper-
triangular system Ux = y . The matrix U occupies the
upper-triangular locations of A . This algorithm
assumes that A [k , k ] ≠ 0 when it is used as a divisor
on lines 6 and 7.
 The serial Gaussian elimination algorithm has three
nested loops.
 Several variations of the algorithm exist, depending on
the order in which the loops are arranged
 Algorithm shows one variation of Gaussian elimination
◦ 1. procedure GAUSSIAN_ELIMINATION (A, b, y)
◦ 2. begin
◦ 3. for k := 0 to n - 1 do /* Outer loop */
◦ 4. begin
◦ 5. for j := k + 1 to n - 1 do
◦ 6. A[k, j] := A[k, j]/A[k, k]; /* Division step */
◦ 7. y[k] := b[k]/A[k, k];
◦ 8. A[k, k] := 1;
◦ 9. for i := k + 1 to n - 1 do
◦ 10. begin
◦ 11. for j := k + 1 to n - 1 do
◦ 12. A[i, j] := A[i, j] - A[i, k] x A[k,
j]; /* Elimination step */
◦ 13. b[i] := b[i] - A[i, k] x y[k];
◦ 14. A[i, k] := 0;
◦ 15. endfor; /* Line 9 */
◦ 16. endfor; /* Line 3 */
◦ 17. end GAUSSIAN_ELIMINATION
 For k varying from 0 to n - 1, the Gaussian elimination
procedure systematically eliminates variable x [k ] from
equations k + 1 to n - 1 so that the matrix of
coefficients becomes upper triangular.
 As shown in Algorithm , in the k th iteration of the
outer loop (starting on line 3), an appropriate multiple
of the k th equation is subtracted from each of the
equations k + 1 to n- 1 (loop starting on line 9).
 The multiples of the k th equation (or the k th row of
matrix A ) are chosen such that the k th coefficient
becomes zero in equations k + 1 to n - 1 eliminating x
[k ] from these equations.
 A typical computation in Gaussian elimination
 The k th iteration of the outer loop does not involve any
computation on rows 1 to k - 1 or columns 1 to k - 1.
Thus, at this stage, only the lower-right (n - k ) x (n - k
) sub-matrix of A (the shaded portion in Figure) is
computationally active.
 Gaussian elimination involves approximately n 2 /2
divisions (line 6) and approximately (n 3 /3) - (n 2 /2)
subtractions and multiplications (line 12).
 we assume that each scalar arithmetic operation takes
unit time. With this assumption, the sequential run time
of the procedure is approximately 2n 3 /3 (for large n );
 We now consider a parallel implementation of Algorithm
, in which the coefficient matrix is rowwise 1-D
partitioned among the processes.
 A parallel implementation of this algorithm with
columnwise 1-D partitioning is very similar.
 We first consider the case in which one row is assigned
to each process, and the n x n coefficient matrix A is
partitioned along the rows among n processes labeled
from P0 to Pn -1
 Gaussian elimination steps during the iteration
corresponding to k = 3 for an 8 x 8 matrix partitioned
rowwise among eight processes.
 Algorithm show that A [k , k + 1], A [k , k + 2], ..., A [k ,
n - 1] are divided by A [k , k ] (line 6) at the beginning
of the k th iteration. All matrix elements participating in
this operation (shown by the shaded portion of the
matrix in Figure (a) ) belong to the same process.
 In the second computation step of the algorithm (the
elimination step of line 12), the modified (after division)
elements of the k th row are used by all other rows of
the active part of the matrix
 As Figure (b) shows, this requires a one-to-all
broadcast of the active part of the k th row to the
processes storing rows k + 1 to n - 1.
 Finally, the computation A [i , j ] := A [i , j ] - A [i , k ] x
A [k , j ] takes place in the remaining active portion of
the matrix, which is shown shaded in Figure (c) .
 The computation step corresponding to Figure (a) in the
k th iteration requires n - k – 1 divisions at process Pk
 Similarly, the computation step of Figure (c) involves
n - k – 1 multiplications and subtractions in the k th
iteration at all processes Pi , such that k < i < n .
Assuming a single arithmetic operation takes unit time,
the total time spent in computation in the k th iteration
is 3(n - k - 1).
 Figures (a) and (c) in this parallel implementation of
Gaussian elimination is,
which is equal to 3n (n - 1)/2.
 The communication step of Figure (b) takes time
(ts +tw (n -k -1)) log n
 the total communication time
 This cost is asymptotically higher than the sequential
run time of this algorithm. Hence, this parallel
implementation is not cost-optimal.
 Introduction to parallel computing second edition by
Ananth Grama, Snshul Gupta , George Karypis, Vipin
Kumar
 https://en.wikipedia.org/wiki/Parallel_algorithm (2015-
11-18)
 https://en.wikipedia.org/wiki/Linear_algebra (2015-
11-18)
Parallel algorithm in linear algebra
Parallel algorithm in linear algebra

More Related Content

What's hot

Optimal Chain Matrix Multiplication Big Data Perspective
Optimal Chain Matrix Multiplication Big Data PerspectiveOptimal Chain Matrix Multiplication Big Data Perspective
Optimal Chain Matrix Multiplication Big Data Perspectiveপল্লব রায়
 
Parallel algorithms
Parallel algorithmsParallel algorithms
Parallel algorithmsDanish Javed
 
Elementary Parallel Algorithms
Elementary Parallel AlgorithmsElementary Parallel Algorithms
Elementary Parallel AlgorithmsHeman Pathak
 
Parallel Algorithms
Parallel AlgorithmsParallel Algorithms
Parallel AlgorithmsHeman Pathak
 
Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)swapnac12
 
Chapter 4: Parallel Programming Languages
Chapter 4: Parallel Programming LanguagesChapter 4: Parallel Programming Languages
Chapter 4: Parallel Programming LanguagesHeman Pathak
 
Cost optimal algorithm
Cost optimal algorithmCost optimal algorithm
Cost optimal algorithmHeman Pathak
 
Programming in python
Programming in pythonProgramming in python
Programming in pythonIvan Rojas
 
Parallel sorting Algorithms
Parallel  sorting AlgorithmsParallel  sorting Algorithms
Parallel sorting AlgorithmsGARIMA SHAKYA
 
Algorithem complexity in data sructure
Algorithem complexity in data sructureAlgorithem complexity in data sructure
Algorithem complexity in data sructureKumar
 
Algorithm analysis (All in one)
Algorithm analysis (All in one)Algorithm analysis (All in one)
Algorithm analysis (All in one)jehan1987
 
Data Structures and Algorithm Analysis
Data Structures  and  Algorithm AnalysisData Structures  and  Algorithm Analysis
Data Structures and Algorithm AnalysisMary Margarat
 

What's hot (20)

Parallel Algorithms
Parallel AlgorithmsParallel Algorithms
Parallel Algorithms
 
Optimal Chain Matrix Multiplication Big Data Perspective
Optimal Chain Matrix Multiplication Big Data PerspectiveOptimal Chain Matrix Multiplication Big Data Perspective
Optimal Chain Matrix Multiplication Big Data Perspective
 
Parallel Algorithms
Parallel AlgorithmsParallel Algorithms
Parallel Algorithms
 
Parallel algorithms
Parallel algorithmsParallel algorithms
Parallel algorithms
 
Parallel Algorithms
Parallel AlgorithmsParallel Algorithms
Parallel Algorithms
 
Parallel quicksort cz. 1
Parallel quicksort cz. 1Parallel quicksort cz. 1
Parallel quicksort cz. 1
 
Aa sort-v4
Aa sort-v4Aa sort-v4
Aa sort-v4
 
Elementary Parallel Algorithms
Elementary Parallel AlgorithmsElementary Parallel Algorithms
Elementary Parallel Algorithms
 
Fourier Transform Assignment Help
Fourier Transform Assignment HelpFourier Transform Assignment Help
Fourier Transform Assignment Help
 
Slide1
Slide1Slide1
Slide1
 
Parallel Algorithms
Parallel AlgorithmsParallel Algorithms
Parallel Algorithms
 
Signal Processing Assignment Help
Signal Processing Assignment HelpSignal Processing Assignment Help
Signal Processing Assignment Help
 
Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)
 
Chapter 4: Parallel Programming Languages
Chapter 4: Parallel Programming LanguagesChapter 4: Parallel Programming Languages
Chapter 4: Parallel Programming Languages
 
Cost optimal algorithm
Cost optimal algorithmCost optimal algorithm
Cost optimal algorithm
 
Programming in python
Programming in pythonProgramming in python
Programming in python
 
Parallel sorting Algorithms
Parallel  sorting AlgorithmsParallel  sorting Algorithms
Parallel sorting Algorithms
 
Algorithem complexity in data sructure
Algorithem complexity in data sructureAlgorithem complexity in data sructure
Algorithem complexity in data sructure
 
Algorithm analysis (All in one)
Algorithm analysis (All in one)Algorithm analysis (All in one)
Algorithm analysis (All in one)
 
Data Structures and Algorithm Analysis
Data Structures  and  Algorithm AnalysisData Structures  and  Algorithm Analysis
Data Structures and Algorithm Analysis
 

Viewers also liked

Parallel Algorithm Models
Parallel Algorithm ModelsParallel Algorithm Models
Parallel Algorithm ModelsMartin Coronel
 
k-NN Text Classification using an FPGA-Based Sparse Matrix Vector Multiplicat...
k-NN Text Classification using an FPGA-Based Sparse Matrix Vector Multiplicat...k-NN Text Classification using an FPGA-Based Sparse Matrix Vector Multiplicat...
k-NN Text Classification using an FPGA-Based Sparse Matrix Vector Multiplicat...Kevin Townsend
 
System of equations
System of equationsSystem of equations
System of equationsmariacadena
 
Solving systems of equations
Solving systems of equationsSolving systems of equations
Solving systems of equationsHind Al Awadi
 
Cramer’s Rule OF Matrix
Cramer’s Rule OF MatrixCramer’s Rule OF Matrix
Cramer’s Rule OF MatrixAbi Malik
 
Parallel algorithms for solving linear systems with block-fivediagonal matric...
Parallel algorithms for solving linear systems with block-fivediagonal matric...Parallel algorithms for solving linear systems with block-fivediagonal matric...
Parallel algorithms for solving linear systems with block-fivediagonal matric...Ural-PDC
 
Cramer's Rule System of Equations
Cramer's Rule System of EquationsCramer's Rule System of Equations
Cramer's Rule System of Equationskevinryanclark
 
Machine learning fro computer vision - a whirlwind of key concepts for the un...
Machine learning fro computer vision - a whirlwind of key concepts for the un...Machine learning fro computer vision - a whirlwind of key concepts for the un...
Machine learning fro computer vision - a whirlwind of key concepts for the un...potaters
 
Cramers rule
Cramers ruleCramers rule
Cramers rulemstf mstf
 
Presentation on inverse matrix
Presentation on inverse matrixPresentation on inverse matrix
Presentation on inverse matrixSyed Ahmed Zaki
 
Matrices & determinants
Matrices & determinantsMatrices & determinants
Matrices & determinantsindu thakur
 
Inverse Matrix & Determinants
Inverse Matrix & DeterminantsInverse Matrix & Determinants
Inverse Matrix & Determinantsitutor
 
Matrices And Determinants
Matrices And DeterminantsMatrices And Determinants
Matrices And DeterminantsDEVIKA S INDU
 

Viewers also liked (20)

Parallel Algorithm Models
Parallel Algorithm ModelsParallel Algorithm Models
Parallel Algorithm Models
 
Chapter 3 pc
Chapter 3 pcChapter 3 pc
Chapter 3 pc
 
k-NN Text Classification using an FPGA-Based Sparse Matrix Vector Multiplicat...
k-NN Text Classification using an FPGA-Based Sparse Matrix Vector Multiplicat...k-NN Text Classification using an FPGA-Based Sparse Matrix Vector Multiplicat...
k-NN Text Classification using an FPGA-Based Sparse Matrix Vector Multiplicat...
 
System of equations
System of equationsSystem of equations
System of equations
 
Solving systems of equations
Solving systems of equationsSolving systems of equations
Solving systems of equations
 
Cramer’s Rule OF Matrix
Cramer’s Rule OF MatrixCramer’s Rule OF Matrix
Cramer’s Rule OF Matrix
 
Equations Revision
Equations RevisionEquations Revision
Equations Revision
 
Matrices - Cramer's Rule
Matrices - Cramer's RuleMatrices - Cramer's Rule
Matrices - Cramer's Rule
 
Parallel algorithms for solving linear systems with block-fivediagonal matric...
Parallel algorithms for solving linear systems with block-fivediagonal matric...Parallel algorithms for solving linear systems with block-fivediagonal matric...
Parallel algorithms for solving linear systems with block-fivediagonal matric...
 
Cramer's Rule System of Equations
Cramer's Rule System of EquationsCramer's Rule System of Equations
Cramer's Rule System of Equations
 
Machine learning fro computer vision - a whirlwind of key concepts for the un...
Machine learning fro computer vision - a whirlwind of key concepts for the un...Machine learning fro computer vision - a whirlwind of key concepts for the un...
Machine learning fro computer vision - a whirlwind of key concepts for the un...
 
Gauss elimination
Gauss eliminationGauss elimination
Gauss elimination
 
Cramers rule
Cramers ruleCramers rule
Cramers rule
 
Presentation on inverse matrix
Presentation on inverse matrixPresentation on inverse matrix
Presentation on inverse matrix
 
Inverse matrix
Inverse matrixInverse matrix
Inverse matrix
 
Parallel Computing
Parallel Computing Parallel Computing
Parallel Computing
 
Matrices & determinants
Matrices & determinantsMatrices & determinants
Matrices & determinants
 
Inverse Matrix & Determinants
Inverse Matrix & DeterminantsInverse Matrix & Determinants
Inverse Matrix & Determinants
 
Matrices And Determinants
Matrices And DeterminantsMatrices And Determinants
Matrices And Determinants
 
Parallel Computing
Parallel ComputingParallel Computing
Parallel Computing
 

Similar to Parallel algorithm in linear algebra

DSP_FOEHU - MATLAB 01 - Discrete Time Signals and Systems
DSP_FOEHU - MATLAB 01 - Discrete Time Signals and SystemsDSP_FOEHU - MATLAB 01 - Discrete Time Signals and Systems
DSP_FOEHU - MATLAB 01 - Discrete Time Signals and SystemsAmr E. Mohamed
 
Gauss jordan and Guass elimination method
Gauss jordan and Guass elimination methodGauss jordan and Guass elimination method
Gauss jordan and Guass elimination methodMeet Nayak
 
tw1979 Exercise 1 Report
tw1979 Exercise 1 Reporttw1979 Exercise 1 Report
tw1979 Exercise 1 ReportThomas Wigg
 
Quantum algorithm for solving linear systems of equations
 Quantum algorithm for solving linear systems of equations Quantum algorithm for solving linear systems of equations
Quantum algorithm for solving linear systems of equationsXequeMateShannon
 
Consider a l-D elastic bar problem defined on [0, 4]. The domain .pdf
Consider a l-D elastic bar problem defined on [0, 4]. The domain .pdfConsider a l-D elastic bar problem defined on [0, 4]. The domain .pdf
Consider a l-D elastic bar problem defined on [0, 4]. The domain .pdfferoz544
 
Series_Solution_Methods_and_Special_Func.pdf
Series_Solution_Methods_and_Special_Func.pdfSeries_Solution_Methods_and_Special_Func.pdf
Series_Solution_Methods_and_Special_Func.pdfmohamedtawfik358886
 
Metodos jacobi y gauss seidel
Metodos jacobi y gauss seidelMetodos jacobi y gauss seidel
Metodos jacobi y gauss seidelCesar Mendoza
 
Metodos jacobi y gauss seidel
Metodos jacobi y gauss seidelMetodos jacobi y gauss seidel
Metodos jacobi y gauss seidelCesar Mendoza
 
Newton cotes integration method
Newton cotes integration  methodNewton cotes integration  method
Newton cotes integration methodshashikant pabari
 
Beginning direct3d gameprogrammingmath05_matrices_20160515_jintaeks
Beginning direct3d gameprogrammingmath05_matrices_20160515_jintaeksBeginning direct3d gameprogrammingmath05_matrices_20160515_jintaeks
Beginning direct3d gameprogrammingmath05_matrices_20160515_jintaeksJinTaek Seo
 
Numerical Solution of Linear algebraic Equation
Numerical Solution of Linear algebraic EquationNumerical Solution of Linear algebraic Equation
Numerical Solution of Linear algebraic Equationpayalpriyadarshinisa1
 
Reachability Analysis "Control Of Dynamical Non-Linear Systems"
Reachability Analysis "Control Of Dynamical Non-Linear Systems" Reachability Analysis "Control Of Dynamical Non-Linear Systems"
Reachability Analysis "Control Of Dynamical Non-Linear Systems" M Reza Rahmati
 
Reachability Analysis Control of Non-Linear Dynamical Systems
Reachability Analysis Control of Non-Linear Dynamical SystemsReachability Analysis Control of Non-Linear Dynamical Systems
Reachability Analysis Control of Non-Linear Dynamical SystemsM Reza Rahmati
 
An Acceleration Scheme For Solving Convex Feasibility Problems Using Incomple...
An Acceleration Scheme For Solving Convex Feasibility Problems Using Incomple...An Acceleration Scheme For Solving Convex Feasibility Problems Using Incomple...
An Acceleration Scheme For Solving Convex Feasibility Problems Using Incomple...Ashley Smith
 

Similar to Parallel algorithm in linear algebra (20)

Daa chapter11
Daa chapter11Daa chapter11
Daa chapter11
 
DSP_FOEHU - MATLAB 01 - Discrete Time Signals and Systems
DSP_FOEHU - MATLAB 01 - Discrete Time Signals and SystemsDSP_FOEHU - MATLAB 01 - Discrete Time Signals and Systems
DSP_FOEHU - MATLAB 01 - Discrete Time Signals and Systems
 
Gauss jordan and Guass elimination method
Gauss jordan and Guass elimination methodGauss jordan and Guass elimination method
Gauss jordan and Guass elimination method
 
tw1979 Exercise 1 Report
tw1979 Exercise 1 Reporttw1979 Exercise 1 Report
tw1979 Exercise 1 Report
 
Quantum algorithm for solving linear systems of equations
 Quantum algorithm for solving linear systems of equations Quantum algorithm for solving linear systems of equations
Quantum algorithm for solving linear systems of equations
 
Consider a l-D elastic bar problem defined on [0, 4]. The domain .pdf
Consider a l-D elastic bar problem defined on [0, 4]. The domain .pdfConsider a l-D elastic bar problem defined on [0, 4]. The domain .pdf
Consider a l-D elastic bar problem defined on [0, 4]. The domain .pdf
 
Chapter26
Chapter26Chapter26
Chapter26
 
Series_Solution_Methods_and_Special_Func.pdf
Series_Solution_Methods_and_Special_Func.pdfSeries_Solution_Methods_and_Special_Func.pdf
Series_Solution_Methods_and_Special_Func.pdf
 
Metodos jacobi y gauss seidel
Metodos jacobi y gauss seidelMetodos jacobi y gauss seidel
Metodos jacobi y gauss seidel
 
Metodos jacobi y gauss seidel
Metodos jacobi y gauss seidelMetodos jacobi y gauss seidel
Metodos jacobi y gauss seidel
 
Newton cotes integration method
Newton cotes integration  methodNewton cotes integration  method
Newton cotes integration method
 
Ijetr021210
Ijetr021210Ijetr021210
Ijetr021210
 
Ijetr021210
Ijetr021210Ijetr021210
Ijetr021210
 
Assignment 1
Assignment 1Assignment 1
Assignment 1
 
Beginning direct3d gameprogrammingmath05_matrices_20160515_jintaeks
Beginning direct3d gameprogrammingmath05_matrices_20160515_jintaeksBeginning direct3d gameprogrammingmath05_matrices_20160515_jintaeks
Beginning direct3d gameprogrammingmath05_matrices_20160515_jintaeks
 
Computer Network Homework Help
Computer Network Homework HelpComputer Network Homework Help
Computer Network Homework Help
 
Numerical Solution of Linear algebraic Equation
Numerical Solution of Linear algebraic EquationNumerical Solution of Linear algebraic Equation
Numerical Solution of Linear algebraic Equation
 
Reachability Analysis "Control Of Dynamical Non-Linear Systems"
Reachability Analysis "Control Of Dynamical Non-Linear Systems" Reachability Analysis "Control Of Dynamical Non-Linear Systems"
Reachability Analysis "Control Of Dynamical Non-Linear Systems"
 
Reachability Analysis Control of Non-Linear Dynamical Systems
Reachability Analysis Control of Non-Linear Dynamical SystemsReachability Analysis Control of Non-Linear Dynamical Systems
Reachability Analysis Control of Non-Linear Dynamical Systems
 
An Acceleration Scheme For Solving Convex Feasibility Problems Using Incomple...
An Acceleration Scheme For Solving Convex Feasibility Problems Using Incomple...An Acceleration Scheme For Solving Convex Feasibility Problems Using Incomple...
An Acceleration Scheme For Solving Convex Feasibility Problems Using Incomple...
 

More from Harshana Madusanka Jayamaha

More from Harshana Madusanka Jayamaha (8)

Handwritten character recognition using artificial neural network
Handwritten character recognition using artificial neural networkHandwritten character recognition using artificial neural network
Handwritten character recognition using artificial neural network
 
Linear and non linear equation
Linear and non linear equationLinear and non linear equation
Linear and non linear equation
 
Clipping ( Cohen-Sutherland Algorithm )
Clipping ( Cohen-Sutherland Algorithm )Clipping ( Cohen-Sutherland Algorithm )
Clipping ( Cohen-Sutherland Algorithm )
 
Advance operator and technique in genetic algorithm
Advance operator and technique in genetic algorithmAdvance operator and technique in genetic algorithm
Advance operator and technique in genetic algorithm
 
Artificial Neural Network Topology
Artificial Neural Network TopologyArtificial Neural Network Topology
Artificial Neural Network Topology
 
Organizational structure
Organizational structureOrganizational structure
Organizational structure
 
Operating system critical section
Operating system   critical sectionOperating system   critical section
Operating system critical section
 
Distributed System - Security
Distributed System - SecurityDistributed System - Security
Distributed System - Security
 

Recently uploaded

"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 

Parallel algorithm in linear algebra

  • 2.  What is Parallel Algorithm  What is Linear Algebra  Dense Matrix Algorithms ◦ Matrix-Vector Multiplication  Solving a System of Linear Equations ◦ A Simple Gaussian Elimination Algorithm  Parallel Implementation with 1-D Partitioning
  • 3.  In computer science, a parallel algorithm, as opposed to a traditional serial algorithm, is an algorithm which can be executed a piece at a time on many different processing devices, and then combined together again at the end to get the correct result. (wikipedia.org)
  • 4.  Linear algebra is the branch of mathematics concerning vector spaces and linear mappings between such spaces. It includes the study of lines, planes, and subspaces, but is also concerned with properties common to all vector spaces.
  • 5.  dense or full matrices that have no or few known usable zero entries.  In numerical analysis, a sparse matrix is a matrix in which most of the elements are zero
  • 6.  This slide addresses the problem of multiplying a dense n x n matrix A with an n x 1 vector x to yield the n x 1 result vector y.  serial algorithm for this problem ◦ 1. procedure MAT_VECT ( A, x, y) ◦ 2. begin ◦ 3. for i := 0 to n - 1 do ◦ 4. begin ◦ 5. y[i]:=0; ◦ 6. for j := 0 to n - 1 do ◦ 7. y[i] := y[i] + A[i, j] x x[j]; ◦ 8. endfor; ◦ 9. end MAT_VECT
  • 7.  The sequential algorithm requires n2 multiplications and additions. Assuming that a multiplication and addition pair takes unit time, the sequential run time is W = n2  At least three distinct parallel formulations of matrix-vector multiplication are possible, depending on whether rowwise 1-D, columnwise 1-D, or a 2-D partitioning is used.
  • 8.  This slide details the parallel algorithm for matrix- vector multiplication using rowwise block 1-D partitioning. The parallel algorithm for columnwise block 1-D partitioning is similar and has a similar expression for parallel run time  Next Figure shows the Multiplication of an n x n matrix with an n x 1 vector using rowwise block 1- D partitioning. For the one-row-per-process case, p = n
  • 9.
  • 10.  First, consider the case in which the n x n matrix is partitioned among n processes so that each process stores one complete row of the matrix.  Figure (a) Process Pi initially owns x[i] and A[i, 0], A[i, 1], ..., A[i, n-1] and is responsible for computing y[i].  Vector x is multiplied with each row of the matrix (Algorithm); hence, every process needs the entire vector.  Since each process starts with only one element of x, an all-to-all broadcast is required to distribute all the elements to all the processes
  • 11.  This section discusses the problem of solving a system of linear equations of the form  In matrix notation, this system is written as Ax = b  Here A is a dense n x n matrix of coefficients such that A [i , j ] = ai , j , b is an n x 1 vector [b 0 , b 1 , ..., bn -1 ]T ,and x is the desired solution vector [x 0 , x 1 , ..., xn -1 ]T
  • 12.  A system of equations Ax = b is usually solved in two stages. First, through a series of algebraic manipulations, the original system of equations is reduced to an upper-triangular system of the form  We write this as Ux = y , where U is a unit upper- triangular matrix – one in which all sub diagonal entries are zero and all principal diagonal entries are equal to one.
  • 13.  A serial Gaussian elimination algorithm that converts the system of linear equations Ax = b to a unit upper- triangular system Ux = y . The matrix U occupies the upper-triangular locations of A . This algorithm assumes that A [k , k ] ≠ 0 when it is used as a divisor on lines 6 and 7.  The serial Gaussian elimination algorithm has three nested loops.  Several variations of the algorithm exist, depending on the order in which the loops are arranged
  • 14.  Algorithm shows one variation of Gaussian elimination ◦ 1. procedure GAUSSIAN_ELIMINATION (A, b, y) ◦ 2. begin ◦ 3. for k := 0 to n - 1 do /* Outer loop */ ◦ 4. begin ◦ 5. for j := k + 1 to n - 1 do ◦ 6. A[k, j] := A[k, j]/A[k, k]; /* Division step */ ◦ 7. y[k] := b[k]/A[k, k]; ◦ 8. A[k, k] := 1; ◦ 9. for i := k + 1 to n - 1 do ◦ 10. begin ◦ 11. for j := k + 1 to n - 1 do ◦ 12. A[i, j] := A[i, j] - A[i, k] x A[k, j]; /* Elimination step */ ◦ 13. b[i] := b[i] - A[i, k] x y[k]; ◦ 14. A[i, k] := 0; ◦ 15. endfor; /* Line 9 */ ◦ 16. endfor; /* Line 3 */ ◦ 17. end GAUSSIAN_ELIMINATION
  • 15.  For k varying from 0 to n - 1, the Gaussian elimination procedure systematically eliminates variable x [k ] from equations k + 1 to n - 1 so that the matrix of coefficients becomes upper triangular.  As shown in Algorithm , in the k th iteration of the outer loop (starting on line 3), an appropriate multiple of the k th equation is subtracted from each of the equations k + 1 to n- 1 (loop starting on line 9).  The multiples of the k th equation (or the k th row of matrix A ) are chosen such that the k th coefficient becomes zero in equations k + 1 to n - 1 eliminating x [k ] from these equations.
  • 16.  A typical computation in Gaussian elimination  The k th iteration of the outer loop does not involve any computation on rows 1 to k - 1 or columns 1 to k - 1. Thus, at this stage, only the lower-right (n - k ) x (n - k ) sub-matrix of A (the shaded portion in Figure) is computationally active.
  • 17.  Gaussian elimination involves approximately n 2 /2 divisions (line 6) and approximately (n 3 /3) - (n 2 /2) subtractions and multiplications (line 12).  we assume that each scalar arithmetic operation takes unit time. With this assumption, the sequential run time of the procedure is approximately 2n 3 /3 (for large n );
  • 18.  We now consider a parallel implementation of Algorithm , in which the coefficient matrix is rowwise 1-D partitioned among the processes.  A parallel implementation of this algorithm with columnwise 1-D partitioning is very similar.  We first consider the case in which one row is assigned to each process, and the n x n coefficient matrix A is partitioned along the rows among n processes labeled from P0 to Pn -1
  • 19.  Gaussian elimination steps during the iteration corresponding to k = 3 for an 8 x 8 matrix partitioned rowwise among eight processes.
  • 20.  Algorithm show that A [k , k + 1], A [k , k + 2], ..., A [k , n - 1] are divided by A [k , k ] (line 6) at the beginning of the k th iteration. All matrix elements participating in this operation (shown by the shaded portion of the matrix in Figure (a) ) belong to the same process.
  • 21.  In the second computation step of the algorithm (the elimination step of line 12), the modified (after division) elements of the k th row are used by all other rows of the active part of the matrix  As Figure (b) shows, this requires a one-to-all broadcast of the active part of the k th row to the processes storing rows k + 1 to n - 1.  Finally, the computation A [i , j ] := A [i , j ] - A [i , k ] x A [k , j ] takes place in the remaining active portion of the matrix, which is shown shaded in Figure (c) .
  • 22.  The computation step corresponding to Figure (a) in the k th iteration requires n - k – 1 divisions at process Pk  Similarly, the computation step of Figure (c) involves n - k – 1 multiplications and subtractions in the k th iteration at all processes Pi , such that k < i < n . Assuming a single arithmetic operation takes unit time, the total time spent in computation in the k th iteration is 3(n - k - 1).  Figures (a) and (c) in this parallel implementation of Gaussian elimination is, which is equal to 3n (n - 1)/2.
  • 23.  The communication step of Figure (b) takes time (ts +tw (n -k -1)) log n  the total communication time  This cost is asymptotically higher than the sequential run time of this algorithm. Hence, this parallel implementation is not cost-optimal.
  • 24.  Introduction to parallel computing second edition by Ananth Grama, Snshul Gupta , George Karypis, Vipin Kumar  https://en.wikipedia.org/wiki/Parallel_algorithm (2015- 11-18)  https://en.wikipedia.org/wiki/Linear_algebra (2015- 11-18)