Title: COMP 5055 Parallel Computing Parallel Implementation of the Conjugate Gradient Method
1COMP 5055 Parallel ComputingParallel
Implementation of the Conjugate Gradient Method
2Outline
- Introduction
- Sequential Algorithm
- Parallel Implementation
- Results
3Introduction The Conjugate Gradient Method
- Iterative method to solve linear systems of the
form Axb. - Matrix A must be symmetric positive definite
4Sequential Algorithm
ConjugateGradient(A,b,x,iter,tol)
residb-Ax dirresid for k1 to iter
do zAdir a ltresid,residgt ß ltdir,zgt µ
a/ß xx µdir residresid- µz a_1
ltresid,residgt if(a_1vtol)then break else ß_1
a_1/a dr ßd end end
Matrix-Vector
Matrix-Vector
Dot Product
Dot Product
5Input Matrix CSR Format
N10
A
col
start
6Rowwise Decomposition of Start vector
A
col
p0
p1
p2
p3
p4
p5
p6
p7
7Rowwise Decomposition of b vector
p0
p1
p2
p3
p4
p5
p6
p7
b
0
1
2
3
4
5
6
7
8
9
8MPI Communication Functions
MPI_Send MPI_Recv
Rowwise Decomposition
DotProduct(a,b)
for i1 to rows do Ciajbi end
MPI_Reduce
MPI_Bcast
9Results (N 100)
10Results (N 100,000)
11Results (N 1,000,000)
12Results Speedup
Conclusion Optimize implementation to reduce
communications