Parallel Deflated CG Method to Simulate Groundwater Flow ...

44
Problem Description Proposed solution Results Conclusions and Recommendations Parallel Deflated CG Method to Simulate Groundwater Flow in a Layered Grid Raju Ram August 24, 2017 1/30

Transcript of Parallel Deflated CG Method to Simulate Groundwater Flow ...

Page 1: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

Parallel Deflated CG Method to SimulateGroundwater Flow in a Layered Grid

Raju Ram

August 24, 2017

1/30

Page 2: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

Agenda

1 Problem DescriptionGroundwater Flow

2 Proposed solution

3 Results

4 Conclusions and Recommendations

2/30

Page 3: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

Hydrology Background

Figure: What is under the earth’s surface

About 98% of the earth’s available fresh water is presentbeneath the earth’s surface in soil pore spaces, calledgroundwater.Hydraulic head calculates measurement of liquid pressure isgroundwater.Darcy’s law defines the movement of water in the subsurface.

3/30

Page 4: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

MODFLOW

MODFLOW softwaredeveloped by U.S GeologicalSurvey is used to simulategroundwater flow.

Cell centered finite volumediscretization: Domain isdivided into rectangularboxes called cells.

Geometries of underlyingcountries are notrectangular, MODFLOWcomputes head only atactive cells (red).

4/30

Page 5: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

Groundwater Flow Equation

∂x

(Kxx

∂h

∂x

)+

∂y

(Kyy

∂h

∂y

)+

∂z

(Kzz

∂h

∂z

)+ W = Ss

∂h

∂t

where,

Kxx , Kyy and Kzz are hydraulic conductivities along the x, y, and zcoordinate axes (LT−1).

W is volumetric flux per unit volume representingsources and sinks of water (T−1) .

Ss is specific storage of porous material (L−1).

h is Hydraulic head (L).

5/30

Page 6: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

Finite Volume Discretization

Flow from cell (i , j − 1, k)into cell (i , j , k):

q(i ,j− 12) = CC(i ,j− 1

2)(hi ,j−1−hi ,j )

Continuity equation:

N∑n=1

qi ,j ,n = Ss∆V∆h

∆t

For N = 6, above becomes

qleft + qright + qup + qdown + qtop

+qbottom = Ss∆V∆h

∆t

6/30

Page 7: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

System of Equations

CV(i ,j ,k− 12)h(i ,j ,k−1) + CR(i− 1

2,j ,k)h(i−1,j ,k) + CC(i ,j− 1

2,k)h(i ,j−1,k)+

Hch(i ,j ,k) + CC(i ,j+ 12),kh(i ,j+1,k) + CR(i+ 1

2,j ,k)h(i+1,j ,k)+

CV(i ,j ,k+ 12)h(i ,j ,k+1) = RHS(i ,j ,k)

System of equations of formAu = f .

Hc depends on h(i , j , k):system of equationsbecomes non-linear.

Picard iteration is used tomake the system linear.

7/30

Page 8: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

Simulation Flowchart

Figure: Grounder water simulation flowchart

8/30

Page 9: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

Block Jacobi Preconditioner M

Preconditioned ConjugateGradient (PCG) in ParallelKrylov Solver (PKS) solves:

M−1Au = M−1f .

For 2 subdomains:(A11 A12

A21 A22

)(u1u2

)=

(f1f2

).

A11u1 = f1 − A12u2

A22u2 = f2 − A21u1

Figure: Partitioning of grid using 2 processors inMODFLOW

9/30

Page 10: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

Nederlands Hydrologisch Instrumentarium (NHI)

MODFLOW: 3DGroundwater flow using 7layers.

Numerical experiments forSteady state (SS) model,Stress loop and time loop isfixed.

Consider outer Picarditeration and inner PCGiteration.

Vary cell size: 250 m, 100m, 50 m.

10/30

Page 11: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

Problem statement

PCG iterations increase withincreasing number ofsubdomains in PKS, due todecoupling in globalinformation.

Goal of this masters projectis to gain wall clock time byreducing the iterationincrease.

11/30

Page 12: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

Summary: Problem Description

So far we covered ...

Hydrological background behind the problem.Finite Volume Discretization.Preconditioner.Problem statement.

Next ...

Deflation Preconditioner

12/30

Page 13: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

Summary: Problem Description

So far we covered ...

Hydrological background behind the problem.Finite Volume Discretization.Preconditioner.Problem statement.

Next ...

Deflation Preconditioner

12/30

Page 14: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

Our approach: Deflation

Eigenvectors with small eigenvalues hampers the PCGconvergence.

(a) Constant deflationvectors (b) Linear deflation vectors

We approximate the eigenvectors with constant deflationvectors (CDPCG) and linear deflation vectors (LDPCG).

Columns of deflation matrix Z are deflation vectors.

13/30

Page 15: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

Basic Idea Behind Deflation Preconditioner

a) Used to remove influence of k small eigenvalues. Conditionnumber reduces to λn

λk+1from λn

λ1.

b) We define projectorP1 = I − AZE−1ZT , P2 = I − ZE−1ZTA

c) Solve for deflated system: P1Au = P1f .

d) u = (I − P2)u + P2u,

e) (I − P2)u in d) becomes ZE−1ZT f .

f) P2u = P2u, substitute u from c) in d) to obtain u.

14/30

Page 16: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

Basic Idea Behind Deflation Preconditioner

a) Used to remove influence of k small eigenvalues. Conditionnumber reduces to λn

λk+1from λn

λ1.

b) We define projectorP1 = I − AZE−1ZT , P2 = I − ZE−1ZTA

c) Solve for deflated system: P1Au = P1f .

d) u = (I − P2)u + P2u,

e) (I − P2)u in d) becomes ZE−1ZT f .

f) P2u = P2u, substitute u from c) in d) to obtain u.

14/30

Page 17: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

Basic Idea Behind Deflation Preconditioner

a) Used to remove influence of k small eigenvalues. Conditionnumber reduces to λn

λk+1from λn

λ1.

b) We define projectorP1 = I − AZE−1ZT , P2 = I − ZE−1ZTA

c) Solve for deflated system: P1Au = P1f .

d) u = (I − P2)u + P2u,

e) (I − P2)u in d) becomes ZE−1ZT f .

f) P2u = P2u, substitute u from c) in d) to obtain u.

14/30

Page 18: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

Basic Idea Behind Deflation Preconditioner

a) Used to remove influence of k small eigenvalues. Conditionnumber reduces to λn

λk+1from λn

λ1.

b) We define projectorP1 = I − AZE−1ZT , P2 = I − ZE−1ZTA

c) Solve for deflated system: P1Au = P1f .

d) u = (I − P2)u + P2u,

e) (I − P2)u in d) becomes ZE−1ZT f .

f) P2u = P2u, substitute u from c) in d) to obtain u.

14/30

Page 19: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

Basic Idea Behind Deflation Preconditioner

a) Used to remove influence of k small eigenvalues. Conditionnumber reduces to λn

λk+1from λn

λ1.

b) We define projectorP1 = I − AZE−1ZT , P2 = I − ZE−1ZTA

c) Solve for deflated system: P1Au = P1f .

d) u = (I − P2)u + P2u,

e) (I − P2)u in d) becomes ZE−1ZT f .

f) P2u = P2u, substitute u from c) in d) to obtain u.

14/30

Page 20: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

Basic Idea Behind Deflation Preconditioner

a) Used to remove influence of k small eigenvalues. Conditionnumber reduces to λn

λk+1from λn

λ1.

b) We define projectorP1 = I − AZE−1ZT , P2 = I − ZE−1ZTA

c) Solve for deflated system: P1Au = P1f .

d) u = (I − P2)u + P2u,

e) (I − P2)u in d) becomes ZE−1ZT f .

f) P2u = P2u, substitute u from c) in d) to obtain u.

14/30

Page 21: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

What to add in PCG to make it DPCG?

Deflation pre processing phase: residual update

solve Eq1 = ZT r (0),E = ZTAZ , sparse LU to decompose E

r (0) = r (0) − AZq1

Deflation runtime phase: DPCG mat-vec prod:

Ax = r (0)Deflation−−−−−→ P1Ax = P1r

(0)

solve Eq(k)3 = ZT v (k)

P1v(k) = v (k) − AZq

(k)3

Deflation post processing phase:

Solve for q2 : Eq2 = ZTAx

Solution correction: u = Z (q1 − q2) + x + u(0)

15/30

Page 22: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

Deflated PCG Algorithm

16/30

Page 23: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

Choosing Deflation Vectors

Extraction of onesubdomain from theNetherlands domain.

The brown layer denoteghost layer cells. Figure: Deflation vectors: a) in CDPCG

and a)-d) in LDPCG

17/30

Page 24: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

Summary: Proposed Solution

We discussed Deflation algorithm.

Choosing deflation vectors in NHI Steady State (SS) model .

What next?: Numerical results for various models.

cell size: 250 m, two layer iMOD unit case.cell size: 100 m, seven layer NHI SS model.cell size: 50 m, seven layer NHI SS model.

18/30

Page 25: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

Summary: Proposed Solution

We discussed Deflation algorithm.

Choosing deflation vectors in NHI Steady State (SS) model .

What next?: Numerical results for various models.

cell size: 250 m, two layer iMOD unit case.cell size: 100 m, seven layer NHI SS model.cell size: 50 m, seven layer NHI SS model.

18/30

Page 26: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

Summary: Proposed Solution

We discussed Deflation algorithm.

Choosing deflation vectors in NHI Steady State (SS) model .

What next?: Numerical results for various models.

cell size: 250 m, two layer iMOD unit case.cell size: 100 m, seven layer NHI SS model.cell size: 50 m, seven layer NHI SS model.

18/30

Page 27: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

250 m, Two Layer iMOD Unit Case Iterations

19/30

Page 28: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

NHI 100m Cellsize: Iteration Improvement

20/30

Page 29: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

NHI 50m Cellsize: Iteration Improvement

21/30

Page 30: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

NHI 50m Cellsize: Inner Iteration in Each Picard Iteration

22/30

Page 31: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

Overview of Results: 100 Subdomains

PCG CDPCG LDPCG LDPCG SU

Cell size Iters Iters SU Iters SU vs CDPCG SU

250 2527 1768 1.43 1496 1.69 1.18

100 10775 5209 2.07 3313 3.25 1.57

50 20927 10244 2.04 4966 4.21 2.06

Table: Speed up in iterations (Iters) for NHI SS model with 100subdomains, SU stands for speed up.

Performance of LDPCG improves for higher resolution odels.

23/30

Page 32: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

Improvement in Wall Clock Time: NHI SS 100m

Huge decrease in iterations Setup time: LDPCG

24/30

Page 33: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

Speed up in NHI SS 100m: 4 subdomains as a reference

25/30

Page 34: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

Challenges

LDPCG method (especially the construction of E ) is difficultto implement.

Load imbalance issue due to active cell of ghost layer arises,even after using Recursive Coordinate Bisection (RCB)domain decomposition.

26/30

Page 35: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

Conclusions

Deflation preconditioner (using linear deflation vectors) haspotential to achieve speed up in a wall clock time by factor 4.

The wall clock improvement is obtained due to huge decreasein iterations.

Linear deflation vectors seems to be the optimal choice in thedeflation preconditioner.

27/30

Page 36: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

Conclusions

Deflation preconditioner (using linear deflation vectors) haspotential to achieve speed up in a wall clock time by factor 4.

The wall clock improvement is obtained due to huge decreasein iterations.

Linear deflation vectors seems to be the optimal choice in thedeflation preconditioner.

27/30

Page 37: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

Conclusions

Deflation preconditioner (using linear deflation vectors) haspotential to achieve speed up in a wall clock time by factor 4.

The wall clock improvement is obtained due to huge decreasein iterations.

Linear deflation vectors seems to be the optimal choice in thedeflation preconditioner.

27/30

Page 38: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

Recommendations

Investigate the serial solver convergence: by changing themaximum number of inner iterations, checking accuracy ofILU(0) subdomain solve.

Reduce the local communication in constructing AZ withlinear deflation vectors.

Investigate the load imbalance in PCG and deflated PCG.

Check Deflation performance in NHI transient simulation.

Implement deflation in other Deltaras packages such asSEAWAT (used for fresh salt groundwater computation).

28/30

Page 39: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

Recommendations

Investigate the serial solver convergence: by changing themaximum number of inner iterations, checking accuracy ofILU(0) subdomain solve.

Reduce the local communication in constructing AZ withlinear deflation vectors.

Investigate the load imbalance in PCG and deflated PCG.

Check Deflation performance in NHI transient simulation.

Implement deflation in other Deltaras packages such asSEAWAT (used for fresh salt groundwater computation).

28/30

Page 40: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

Recommendations

Investigate the serial solver convergence: by changing themaximum number of inner iterations, checking accuracy ofILU(0) subdomain solve.

Reduce the local communication in constructing AZ withlinear deflation vectors.

Investigate the load imbalance in PCG and deflated PCG.

Check Deflation performance in NHI transient simulation.

Implement deflation in other Deltaras packages such asSEAWAT (used for fresh salt groundwater computation).

28/30

Page 41: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

Recommendations

Investigate the serial solver convergence: by changing themaximum number of inner iterations, checking accuracy ofILU(0) subdomain solve.

Reduce the local communication in constructing AZ withlinear deflation vectors.

Investigate the load imbalance in PCG and deflated PCG.

Check Deflation performance in NHI transient simulation.

Implement deflation in other Deltaras packages such asSEAWAT (used for fresh salt groundwater computation).

28/30

Page 42: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

Recommendations

Investigate the serial solver convergence: by changing themaximum number of inner iterations, checking accuracy ofILU(0) subdomain solve.

Reduce the local communication in constructing AZ withlinear deflation vectors.

Investigate the load imbalance in PCG and deflated PCG.

Check Deflation performance in NHI transient simulation.

Implement deflation in other Deltaras packages such asSEAWAT (used for fresh salt groundwater computation).

28/30

Page 43: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

References

Jarno Verkaik, First Applications of the New Parallel KrylovSolver for MODFLOW on a National and Global Scale.

PKS Workshop, iMOD Delft software days (DSD), 14 June2017, Deltares

29/30

Page 44: Parallel Deflated CG Method to Simulate Groundwater Flow ...

Problem Description Proposed solution Results Conclusions and Recommendations

Questions/Feedback ?

30/30