SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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
 

Destaque

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
 

Destaque (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
 

Semelhante a 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
 

Semelhante a 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...
 

Mais de Harshana Madusanka Jayamaha

Mais de 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
 

Último

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 

Último (20)

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 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)