Download presentation
Presentation is loading. Please wait.
Published byIlene Small Modified over 9 years ago
1
PARALLELIZATION OF MULTIPLE BACKSOLVES James Stanley April 25, 2002 Project #2
2
PARALLELIZATION OF MULTIPLE BACKSOLVES Project #2 Introduction (Backsolve) Challenge Example ( m = 5) Problem Description Solution Technique Parallel Implementation Results
3
Introduction (Backsolve) If R is an upper triangular matrix, a backsolve is a solution of the equation, Rx=b Where b is a vector of length m. The formulas for the solution are
4
Introduction (Backsolve) cont. m th equation: r mm x m = b m => x m = bmbm r mm ___ m-1 th equation: r m-1,m-1 x m-1 + r m-1,m x m = b m-1 => x m-1 = b m-1 - r m-1, * x m __________________ r m-1 from m th equation
5
Introduction (Backsolve) cont. i th equation: r ii, x i + r i,i+1 x i+1 + …+ r im, x i = b i, for 0 i m-1 =>
6
Challenge Storage: To avoid storing zeros, store n ( n +1)/2 nonzero elements of R 1 in a 1-Dimensional array by rows, and the m ( m +1)/2 Nonzero elements of R 2 in a 1-Dimensional array by rows.
7
Example Suppose m = 5, then or,
8
Example cont. Solving for the x i ’s provides in memory
9
Problem Description Given RHS matrix H to solve for the nxm unknown matrix Y : R 1 YR 2 T = H Where R 1 is a square upper triangular matrix of order nxn and R 2 is a square upper triangular matrix of order mxm.
10
Solution Technique (2) Let Z = R 1 Y (1) Then R 1 YR 2 T = ZR 2 T ZR 2 T = H R 2 Z T = H T Parallel Solution of (1) and (2): (1) R 2 T =H T = (h 1,h 2,…,h n ) (2) R 1 Y = Z = (z 1,z 2,…,z m ) 1 rst solve (1) for the mxn matrix Z T. 2 nd take the Transpose of Z T to get Z. 3 rd solve (2) for the nxm solution matrix Y.
11
Parallel Implementation 1.Generate H T and R 2, R 1 on Process 0, using a Random Number Generator. 2.Move all of R 2 to all processes with the MPI_BCAST. (If there are p processors, then make sure n/p and m/p are integers. 3.Ship the n/p of the rows of H to each process with MPI_Scatter. 4.On each process solve n/p equations for local Z. 5.Ship all of the columns of Z using MPI_Gather to process 0. 6.Perform the transpose of Z on process 0. 7.Ship m/p of the rows of Z T to each process with MPI_Scatter. 8.On each process solve m/p equations for local Y. 9.Ship all of the m/p columns of local Y to process 0 and print the solution on process 0. Denotes communication time Denotes computation time
12
Results
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.