Parallel Multigrid a Scalable Alternative to Parallel CG? · • parallel multigrid –examples •...
Transcript of Parallel Multigrid a Scalable Alternative to Parallel CG? · • parallel multigrid –examples •...
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Parallel Multigrid –
a Scalable Alternative to
Parallel CG?
Miriam Mehl
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
• different stories about parallel multigrid
• parallel multigrid – theoretical performance
• parallel multigrid – examples
• parallel multigrid with Peano
• conclusions
Outline
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
• different stories about parallel multigrid
• parallel multigrid – theoretical performance
• parallel multigrid – examples
• parallel multigrid with Peano
• conclusions
Outline
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Can we parallelize a solver iteration in a scalable way?
Story 1
ix 1ix
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
• parallel cg with “optimal” speedup
• #processors ~ #unknowns
Parallel Speedup CG
0
1,5
3
4,5
6
1 4 16 64 256 1024
2^5 2^6 2^7 2^8 2^9 2^10
p
h
CG
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
• parallel smoother with optimal speedup
• #processors ~ #unknowns (on the finest level!)
Parallel Speedup MG
0
1,5
3
4,5
6
7,5
1 4 16 64 256 1024
2^5 2^6 2^7 2^8 2^9 2^10
p
h
MG
CG
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Can we parallelize a solver iteration in a scalable way?
cg: yes, we can
mg: probably not
Story 1
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Can we parallelize the solver in a scalable way?
Story 2
0x finalx
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
• parallel cg with “optimal” speedup per iteration
• #processors ~ #unknowns
Parallel Speedup CG
0500
1000150020002500300035004000
1 4 16 64 256 1024
2^5 2^6 2^7 2^8 2^9 2^10
p…
CG
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
• parallel smoother with optimal speedup
• #processors ~ #unknowns (on the finest level!)
Parallel Speedup MG
0500
1000150020002500300035004000
1 4 16 64 256 1024
2^5 2^6 2^7 2^8 2^9 2^10
p…
MG
CG
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
• parallel smoother with optimal speedup
• #processors ~ #unknowns (on the finest level!)
Parallel Speedup MG
01020304050607080
1 4 16 64 256 1024
2^5 2^6 2^7 2^8 2^9 2^10
p…
MG
CG
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Can we parallelize the solver in a scalable way?
cg: no, we can’t
almost perfect
Story 2
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
• different stories about parallel multigrid
• parallel multigrid – theoretical performance
• parallel multigrid – examples
• parallel multigrid with Peano
• conclusions
Outline
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
• parallel cg with “optimal” speedup
• #processors ~ #unknowns
Parallel Speedup CG
)(ln
)1(
pOyx
Oax
T
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
• parallel cg with “optimal” speedup
• #processors ~ #unknowns
Parallel Speedup CG
)1(
1
141
1
1
141
1
1
O
x
x
pi
i
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
• parallel cg with “optimal” speedup
• #processors ~ #unknowns
Parallel Speedup CG
ln
44332211
34341212p)O(
yxyxyxyx
yxyx
yx
TTTT
TT
T
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Parallel Speedup CG
#iterations?
h h/2 h/4 h/8
#iterations until e
#iterations until discretization accuracy
O(1/h)
O(ln(1/h)/h)
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Parallel Speedup CG
total time
to solve?
h h/2 h/4 h/8
O(1/h)
O(ln(1/h)/h)
iterations#
1ln
11
iteration 1
ln 2121
hhd
hdpcc
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Parallel Speedup MG
• parallel smoother with optimal speedup
• #processors ~ #unknowns (on the finest level!)
• #processors = const on all levels
time T time T/4
computation > communication
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Parallel Speedup MG
• parallel smoother with optimal speedup
• #processors ~ #unknowns (on the finest level!)
• #processors = const on all levels
time T time T time T/2
computation < communication
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Parallel Speedup MG
• parallel smoother with optimal speedup
• #processors ~ #unknowns (on the finest level!)
• #processors = const on all levels
time T
#dof < #proc
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Parallel Speedup MG
• parallel smoother with optimal speedup
• #processors ~ #unknowns (on the finest level!)
• #processors = const on all levels
time T time T time T
#dof < #proc
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Parallel Speedup MG
#dof < #proc
Tcomp < Tcomm
Tcomp > Tcomm
level 0
level L1
level L2
level Lmax
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Parallel Speedup MG
#dof < #proc
Tcomp < Tcomm
Tcomp > Tcomm
level 0
level L1
level L2
level Lmax
d
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Parallel Speedup MG
#dof < #proc
Tcomp < Tcomm
Tcomp > Tcomm
level 0
level L1
level L2
level Lmax
d
)(3
4 time maxLT
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Parallel Speedup MG
#dof < #proc
Tcomp < Tcomm
Tcomp > Tcomm
level 0
level L1
level L2
level Lmax
d
c
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Parallel Speedup MG
#dof < #proc
Tcomp < Tcomm
Tcomp > Tcomm
level 0
level L1
level L2
level Lmax
d
c
)(4
2)(2time max2 LTLT
d
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Parallel Speedup MG
#dof < #proc
Tcomp < Tcomm
Tcomp > Tcomm
level 0
level L1
level L2
level Lmax
d
c
ln(p)
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Parallel Speedup MG
#dof < #proc
Tcomp < Tcomm
Tcomp > Tcomm
level 0
level L1
level L2
level Lmax
d
c
ln(p)/2
)()ln(24
1time max1
LTpcd
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Parallel Speedup MG
total time
per iteration?
0
ln(p)
ln(p)+c
ln(p)+c+d
p
max1total
3
4
4
2
24
lnLT
pT
dcd
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Parallel Speedup MG
total time
to solve?
iterations#
1lnd
iteration 1
3
4
4
2
24
ln21max1total
hdLT
pT
dcd
h h/2 h/4 h/8
O(1)
O(ln(1/h))
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
• different stories about parallel multigrid
• parallel multigrid – theoretical performance
• parallel multigrid – examples
• parallel multigrid with Peano
• conclusions
Outline
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
First Example
Berger / Aftosmith / Adomavicius
2000 (Intl. Conf. on Parallel CFD)
transsonic flow
adaptive octree grids
partitioning: Hilbert-Peano SFC
(levelwise)
106 unknowns
SGI Origin 2000
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
First Example
Berger / Aftosmith / Adomavicius
2000 (Intl. Conf. on Parallel CFD)
transsonic flow
adaptive octree grids
partitioning: Hilbert-Peano SFC
(levelwise)
106 unknowns
SGI Origin 2000
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
6 levels mg
single grid solver
p
First Example – Berger et Al.
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
m
p
m+c+d
m+c
First Example – Berger et Al.
)(7
8
83
42 maxtotal LTaT
d
mq
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Second Example
Sampath / Biros 2009 (SIAM SISC)
linear elastoplastics
adaptive octree grids
partitioning: modified Morton
(levelwise)
#unknowns ~ #processors
Ranger / Bigben
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
0
10
20
30
40
50
60
70
80
90
2^0 2^2 2^4 2^6 2^8 2^10
run
tim
e
p/12
MG linear elastoplastics
Second Example
Sampath / Biros 2009 (SIAM SISC)
linear elastoplastics
adaptive octree grids
partitioning: modified Morton
(levelwise)
#unknowns ~ #processors
Ranger / Bigben
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
mg reducing p
mg constant p
0
20
40
60
80
100
2^0 2^2 2^4 2^6 2^8 2^10
run
tim
e
p/12
direct solver
p
Second Example – Sampath/Biros
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
p
m
ln(p)/4+c
ln(p)/4+c+d
Second Example – Sampath/Biros
)(7
8
48
)ln(2 maxtotal LT
mcpaT
d
mq
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Third Example
Rüde/Gradl 2008 (PASA)
Poisson equation
hierarchical hybrid grids
Partitioning: Metis on the coarse grid
#unknowns ~ #processors
SGI Altix 4700 (HLRB II, LRZ)
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
0
0,5
1
1,5
2
2,5
3
3,5
4
4,5
4 8 16 32 64 128 256
134,2 268,4 536,9 1073,7 2147,5 4295 8455,7
run
tim
e
p
elements
HGG 3D
Third Example
Rüde/Gradl 2008 (PASA)
Poisson equation
hierarchical hybrid grids
Partitioning: Metis on the coarse grid
#unknowns ~ #processors
SGI Altix 4700 (HLRB II, LRZ)
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
0
1
2
3
4
5
6
7
504 2040 4080
16911,4 68451 136902,1
run
tim
e
p
elements
HHG
Third Example
Rüde/Gradl 2008 (PASA)
Poisson equation
hierarchical hybrid grids
Partitioning: Metis on the coarse grid
#unknowns ~ #processors
SGI Altix 4700 (HLRB II, LRZ)
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
01234567
504 2040 4080
16911,4 68451 136902,1
run
tim
e
p…
HHG
p
Third Example – Gradl/Rüde
mg constant p
single grid solver /
AMG
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
p
m
m+d
Third Example – Gradl/Rüde
)(7
82 maxtotal LTaT mq
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
p
ln(p)
ln(p)+c
ln(p)+c+d
Third Example – Gradl/Rüde
)(7
8
83
4maxtotal LTpaT
d
q
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Fourth Example
Griebel/Zumbusch 2002 (NIC Series)
Poisson equation
octree grids
Partitioning: space-filling curves
#unknowns ~ #processors
ASCI Blue Pacific
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Fourth Example
Griebel/Zumbusch 2002 (NIC Series)
Poisson equation
octree grids
Partitioning: space-filling curves
#unknowns ~ #processors
ASCI Blue Pacific
0
1
2
3
4
5
6
7
1 4 16 64 256
1089 4834 16948 64251 251468
run
tim
e
p
nodes
MG Poisson 2D
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
BPX
• for comparison: multiplicative mg
smooth
smooth
smooth
smooth
smooth
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
BPX
• preconditioned CG
• additive multigrid preconditioner r(A) = O(1)
smooth
smooth
smooth
smooth
smooth
smooth
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
• different stories about parallel multigrid
• parallel multigrid – theoretical performance
• parallel multigrid – examples
• parallel multigrid with Peano
• conclusions
Outline
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
The PDE Framework Peano
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Peano
• tree-oriented partitioning
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Peano
• tree-oriented partitioning
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Peano
• tree-oriented partitioning
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Peano
• tree-oriented partitioning
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Peano
• tree-oriented partitioning
1. join
2. fork
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Peano
• tree-oriented partitioning
efficient parallel partitioning
efficient parallel rebalancing
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Peano
• additive multigrid local operations
• dehierarchization
• compute residual
• smooth
• restrict residual
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Peano
• all level communication
process 1 process 2
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Peano
Results 2009
Tobias Weinzierl
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Peano
Results 2009
Tobias Weinzierl
2D #vertices:
6.70e05
5.00e07
3.95e09
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Peano
Results 2009
Tobias Weinzierl
3D #vertices:
1.60e07
4.40e08
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Peano
• multiplicative multigrid idea
grid coarsening
input stream stacks output stream
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Peano
• multiplicative multigrid idea
grid refinement
input stream stacks output stream
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Peano
0
ln(p)
ln(p)+c
ln(p)+c+d
p
maxtotal
3
4
4
2
24
lnLT
pT
dcd
2D
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Peano
0
ln(p)
ln(p)+c
ln(p)+c+d
p
maxtotal
7
8
8
2
48
lnLT
pT
dcd
3D
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
• different stories about parallel multigrid
• parallel multigrid – theoretical performance
• parallel multigrid – examples
• parallel multigrid with Peano
• conclusions
Outline
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl
Conclusion
• correct measure: time until convergence
• cg superior to mg on petascale systems?
• non-optimal scalability: time ~ ln(p)
• good results for octree-like or partly structured grids
• can we find an optimal O(lnp) parallel solver?
Technische Universität München
April 2010, Lehrstuhltreffen Spitzingsee Miriam Mehl