研究会「素核宇融合による計算基礎物理学の進展」 ….../ Akira IMAKURA Center...

24
/ 24 研究会「素核宇融合による計算基礎物理学の進展」 @合歓の郷 2011 / 12/ 4 Damped Jacobi-type Preconditioner for Supernova Simulation 今倉 暁 / Akira IMAKURA Center for Computational Sciences, University of Tsukuba Joint work with 櫻井鉄也(筑波大学), 住吉光介(沼津高専), 松古栄夫(KEK) 1

Transcript of 研究会「素核宇融合による計算基礎物理学の進展」 ….../ Akira IMAKURA Center...

Page 1: 研究会「素核宇融合による計算基礎物理学の進展」 ….../ Akira IMAKURA Center for Computational Sciences, University of Tsukuba Joint work with 櫻井鉄也(筑波大学),

/ 24

研究会「素核宇融合による計算基礎物理学の進展」 @合歓の郷 2011 / 12/ 4

Damped Jacobi-type Preconditioner

for Supernova Simulation 今倉 暁 / Akira IMAKURA

Center for Computational Sciences, University of Tsukuba

Joint work with 櫻井鉄也(筑波大学), 住吉光介(沼津高専), 松古栄夫(KEK)

1

Page 2: 研究会「素核宇融合による計算基礎物理学の進展」 ….../ Akira IMAKURA Center for Computational Sciences, University of Tsukuba Joint work with 櫻井鉄也(筑波大学),

/ 24

研究会「素核宇融合による計算基礎物理学の進展」 @合歓の郷 2011 / 12/ 4

Introduction Target simulation Supernova simulation -- 3D Neutrino transfer (time evolution of neutrino distribution)

νe νe

νe flux r-direction

νµ

[Sumiyoshi, 2011]

2

Page 3: 研究会「素核宇融合による計算基礎物理学の進展」 ….../ Akira IMAKURA Center for Computational Sciences, University of Tsukuba Joint work with 櫻井鉄也(筑波大学),

/ 24

研究会「素核宇融合による計算基礎物理学の進展」 @合歓の郷 2011 / 12/ 4

Introduction Target simulation Scale -- NrxNqxNf = 200 x 9 x 9, NexNnqxNnf = 14 x 6 x 12 -- 1/8 circle, r = 0~1140 km Outline -- Time evolution : Implicit method → It is required to solve large and sparse linear systems -- The most time consuming part is to solve the systems -- Required time evolution : t = 1 [sec.] → Larger time step (Δt) is required (Δt ≈ 10-5 [sec.]) -- Larger Δt leads to more ill-conditioned systems

3

Page 4: 研究会「素核宇融合による計算基礎物理学の進展」 ….../ Akira IMAKURA Center for Computational Sciences, University of Tsukuba Joint work with 櫻井鉄也(筑波大学),

/ 24

研究会「素核宇融合による計算基礎物理学の進展」 @合歓の郷 2011 / 12/ 4

Introduction

Num

ber o

f ite

ratio

ns

Our main goal of this talk Propose a Damped Jacobi-type preconditioner (with parameter estimation) for supernova simulation

Time step (Δt)

Traditional code for linear systems Bi-CGSTAB with diagonal scaling

4

did not converge

Page 5: 研究会「素核宇融合による計算基礎物理学の進展」 ….../ Akira IMAKURA Center for Computational Sciences, University of Tsukuba Joint work with 櫻井鉄也(筑波大学),

/ 24

研究会「素核宇融合による計算基礎物理学の進展」 @合歓の郷 2011 / 12/ 4

Outline Introduction Solvers and preconditioners for linear systems Parameter estimation for damped Jacobi-type preconditioner Damped Jacobi-type method Parameter estimation Application to supernova simulation Conclusion

5

Page 6: 研究会「素核宇融合による計算基礎物理学の進展」 ….../ Akira IMAKURA Center for Computational Sciences, University of Tsukuba Joint work with 櫻井鉄也(筑波大学),

/ 24

研究会「素核宇融合による計算基礎物理学の進展」 @合歓の郷 2011 / 12/ 4

Solvers and preconditioners Target problem Large, sparse, real and non-symmetric linear systems: obtained from supernova simulation.

Solvers for linear systems Direct methods -- Gaussian elimination, LU decomposition, ...

Stationary iterative methods -- Jacobi, Gauss-Seidel, SOR, ...

Preconditioned Krylov subspace (iterative) methods -- Conjugate Gradient (CG) , GMRES, Bi-CGSTAB, ...

6

Page 7: 研究会「素核宇融合による計算基礎物理学の進展」 ….../ Akira IMAKURA Center for Computational Sciences, University of Tsukuba Joint work with 櫻井鉄也(筑波大学),

/ 24

研究会「素核宇融合による計算基礎物理学の進展」 @合歓の郷 2011 / 12/ 4

Solvers and preconditioners Krylov subspace method Basic ideal: Projection method based on the Krylov subspace Rough sketch (initial guess: )

7

Page 8: 研究会「素核宇融合による計算基礎物理学の進展」 ….../ Akira IMAKURA Center for Computational Sciences, University of Tsukuba Joint work with 櫻井鉄也(筑波大学),

/ 24

研究会「素核宇融合による計算基礎物理学の進展」 @合歓の郷 2011 / 12/ 4

Solvers and preconditioners Preconditioners for Krylov subspace methods Convergence of Krylov subspace methods

Preconditioners

Distribution of eigenvalues

Im

Re

Convergence history

rela

tive

resid

ual n

orm

Number of iteration

Convergence depend on distribution of eigenvalues

8

Page 9: 研究会「素核宇融合による計算基礎物理学の進展」 ….../ Akira IMAKURA Center for Computational Sciences, University of Tsukuba Joint work with 櫻井鉄也(筑波大学),

/ 24

研究会「素核宇融合による計算基礎物理学の進展」 @合歓の郷 2011 / 12/ 4

Solvers and preconditioners Preconditioners for Krylov subspace methods Incomplete factorization type -- IC, ILU, ...

Approximate inverse type -- SPAI, polynomial preconditioner, (diagonal) scaling, ...

Variable type (use some iterative method) -- GMRES, Jacobi, Damped Jacobi-type method

Our goals of this talk Propose a parameter estimation technique for damped Jacobi-type preconditioner

Examine the performance of the proposed preconditioner for linear systems from supernova simulation

9

Page 10: 研究会「素核宇融合による計算基礎物理学の進展」 ….../ Akira IMAKURA Center for Computational Sciences, University of Tsukuba Joint work with 櫻井鉄也(筑波大学),

/ 24

研究会「素核宇融合による計算基礎物理学の進展」 @合歓の郷 2011 / 12/ 4

Outline Introduction Solvers and preconditioners for linear systems Parameter estimation for damped Jacobi-type preconditioner Damped Jacobi-type method Parameter estimation Application to supernova simulation Conclusion

10

Page 11: 研究会「素核宇融合による計算基礎物理学の進展」 ….../ Akira IMAKURA Center for Computational Sciences, University of Tsukuba Joint work with 櫻井鉄也(筑波大学),

/ 24

研究会「素核宇融合による計算基礎物理学の進展」 @合歓の郷 2011 / 12/ 4

Parameter estimation for Damped Jacobi-type prec. Stationary iterative methods Initial partition where is assumed to be nonsingular Recurrence formula Convergence of stationary iterative method

Convergence depend on spectral radius of iteration matrix:

11

Page 12: 研究会「素核宇融合による計算基礎物理学の進展」 ….../ Akira IMAKURA Center for Computational Sciences, University of Tsukuba Joint work with 櫻井鉄也(筑波大学),

/ 24

研究会「素核宇融合による計算基礎物理学の進展」 @合歓の郷 2011 / 12/ 4

Parameter estimation for Damped Jacobi-type prec. Ideal Stationary iterative methods High convergence -- It has small

High speed -- It requires small computational costs per iteration

High parallelization efficiency -- It has less sequential process (in each iteration)

Traditional stationary iterative methods M N

Jacobi Gauss-Seidel

SOR

Convergence Speed Parallelization

Bad Good Good Good Good Bad

Bad -- Excellent Good Bad

Jacobi method (suitable for parallelization)

12

Page 13: 研究会「素核宇融合による計算基礎物理学の進展」 ….../ Akira IMAKURA Center for Computational Sciences, University of Tsukuba Joint work with 櫻井鉄也(筑波大学),

/ 24

研究会「素核宇融合による計算基礎物理学の進展」 @合歓の郷 2011 / 12/ 4

Damped Jacobi method transforms the Jacobi’s recurrence formula: into by using damping parameter in order to improve the convergence rate of Jacobi method.

Parameter estimation for Damped Jacobi-type prec. Damped Jacobi methods Basic ideal:

13

Page 14: 研究会「素核宇融合による計算基礎物理学の進展」 ….../ Akira IMAKURA Center for Computational Sciences, University of Tsukuba Joint work with 櫻井鉄也(筑波大学),

/ 24

研究会「素核宇融合による計算基礎物理学の進展」 @合歓の郷 2011 / 12/ 4

Damped Jacobi method transforms the Jacobi’s recurrence formula: into by using damping parameter and some diagonal matrix in order to improve the convergence rate of Jacobi method.

Parameter estimation for Damped Jacobi-type prec. Damped Jacobi-type methods Basic ideal:

14

Users need to set the parameter α, and the convergence depend strongly on the parameter α

Page 15: 研究会「素核宇融合による計算基礎物理学の進展」 ….../ Akira IMAKURA Center for Computational Sciences, University of Tsukuba Joint work with 櫻井鉄也(筑波大学),

/ 24

研究会「素核宇融合による計算基礎物理学の進展」 @合歓の郷 2011 / 12/ 4

Parameter estimation for Damped Jacobi-type prec. Convergence theorem of damped Jacobi-type method

Theorem 1: Optimal damping parameter Let be the inner region of the circle with center and radius on the complex plane, and let be defined by

Then the spectral radius of iteration matrix of damped Jacobi-type method is minimized by

, and the minimized value is

15

Page 16: 研究会「素核宇融合による計算基礎物理学の進展」 ….../ Akira IMAKURA Center for Computational Sciences, University of Tsukuba Joint work with 櫻井鉄也(筑波大学),

/ 24

研究会「素核宇融合による計算基礎物理学の進展」 @合歓の郷 2011 / 12/ 4

Parameter estimation for Damped Jacobi-type prec. Convergence theorem of damped Jacobi-type method

Theorem 2: Convergence condition if and only if

The minimized spectral radius of iteration matrix of damped Jacobi-type method satisfies the following inequality:

or

16

Page 17: 研究会「素核宇融合による計算基礎物理学の進展」 ….../ Akira IMAKURA Center for Computational Sciences, University of Tsukuba Joint work with 櫻井鉄也(筑波大学),

/ 24

研究会「素核宇融合による計算基礎物理学の進展」 @合歓の郷 2011 / 12/ 4

Parameter estimation for Damped Jacobi-type prec. Convergence theorem of damped Jacobi-type method

Remark: Distribution of eigenvalues and Optimal parameter Distribution of

17 Damping parameter can be optimized extreme eigenvalues Damping parameter can be optimized distribution of eigenvalues

Page 18: 研究会「素核宇融合による計算基礎物理学の進展」 ….../ Akira IMAKURA Center for Computational Sciences, University of Tsukuba Joint work with 櫻井鉄也(筑波大学),

/ 24

研究会「素核宇融合による計算基礎物理学の進展」 @合歓の郷 2011 / 12/ 4

Parameter estimation for Damped Jacobi-type prec. Parameter estimation (proposal preconditioner) Basic ideal: Offline tuning -- Damping parameter is estimated before algorithms run.

Initial guess Diagonal matrix Input

Approximate extreme eigenvalues of by some iterations of Arnoldi method Parameter

estimation I

Estimate from approximated extreme eigenvalues Parameter

estimation II

Run damped Jacobi-type preconditined Krylov subspace method with estimated damping parameter Preconditioned

Krylov

18

Page 19: 研究会「素核宇融合による計算基礎物理学の進展」 ….../ Akira IMAKURA Center for Computational Sciences, University of Tsukuba Joint work with 櫻井鉄也(筑波大学),

/ 24

研究会「素核宇融合による計算基礎物理学の進展」 @合歓の郷 2011 / 12/ 4

Outline Introduction Solvers and preconditioners for linear systems Parameter estimation for damped Jacobi-type preconditioner Damped Jacobi-type method Parameter estimation Application to supernova simulation Conclusion

19

Page 20: 研究会「素核宇融合による計算基礎物理学の進展」 ….../ Akira IMAKURA Center for Computational Sciences, University of Tsukuba Joint work with 櫻井鉄也(筑波大学),

/ 24

研究会「素核宇融合による計算基礎物理学の進展」 @合歓の郷 2011 / 12/ 4

Application to supernova simulation Supernova simulation Scale -- NrxNqxNf = 200 x 9 x 9, NexNnqxNnf = 14 x 6 x 12 -- 1/8 circle, r = 0~1140 km Obtained linear systems -- Dimension ≈ 16 million -- Number of nonzeros ≈ 1.28 billion (Average nonzeros per row or column ≈ 80)

Experimental condition KEK SR16000/M1 -- 1 node 32 cores (logical CPU 64 cores)

20

Page 21: 研究会「素核宇融合による計算基礎物理学の進展」 ….../ Akira IMAKURA Center for Computational Sciences, University of Tsukuba Joint work with 櫻井鉄也(筑波大学),

/ 24

研究会「素核宇融合による計算基礎物理学の進展」 @合歓の郷 2011 / 12/ 4

Application to supernova simulation Proposed preconditioner Bi-CGSTAB with Damped Jacobi-type preconditioner -- Iteration for preconditioner : 20 -- Approximate extreme eigenvalues : 20 iters of Arnoldi -- Cutoff parameter : 0.01 -- Diagonal matrix :

21

Page 22: 研究会「素核宇融合による計算基礎物理学の進展」 ….../ Akira IMAKURA Center for Computational Sciences, University of Tsukuba Joint work with 櫻井鉄也(筑波大学),

/ 24

研究会「素核宇融合による計算基礎物理学の進展」 @合歓の郷 2011 / 12/ 4

Application to supernova simulation Numerical results Time step (Δt) v.s. number of iterations -- Bi-CGSTAB with Diagonal scaling / Proposed precond.

22

Num

ber o

f ite

ratio

ns

Time step (Δt) Computational time [sec.] -- Diagonal scaling: 0.3 / iter -- Proposed: 3.0 / iter (estimation: 3.0 / 1 diagonal matrix)

Page 23: 研究会「素核宇融合による計算基礎物理学の進展」 ….../ Akira IMAKURA Center for Computational Sciences, University of Tsukuba Joint work with 櫻井鉄也(筑波大学),

/ 24

研究会「素核宇融合による計算基礎物理学の進展」 @合歓の郷 2011 / 12/ 4

Outline Introduction Solvers and preconditioners for linear systems Parameter estimation for damped Jacobi-type preconditioner Damped Jacobi-type method Parameter estimation Application to supernova simulation Conclusion

23

Page 24: 研究会「素核宇融合による計算基礎物理学の進展」 ….../ Akira IMAKURA Center for Computational Sciences, University of Tsukuba Joint work with 櫻井鉄也(筑波大学),

/ 24

研究会「素核宇融合による計算基礎物理学の進展」 @合歓の郷 2011 / 12/ 4

Conclusion Conclusion In this talk, we proposed Damped Jacobi-type preconditioner with parameter estimation. From our numerical experiments, we leaned that the proposed preconditioner will be efficient for supernova simulation.

Further investigation Further improvement of the proposed preconditioner -- Implementation -- Another acceleration techniques

24