acceleration of time integration print · 2010. 8. 11. · rick archibald, john drake, kate evans,...

47
Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White , Pat Worley Acceleration of Time Integration 1 Research sponsored by the Laboratory Directed Research and Development Program of Oak Ridge National Laboratory (ORNL), managed by UT-Battelle, LLC for the U. S. Department of Energy under Contract No. DE- AC05-00OR22725. This research used resources of the National Center for Computational Sciences at Oak Ridge National Laboratory, which is supported by the Office of Science of the U.S. Department of Energy under Contract No. DE-AC05-00OR22725. edited version, with extra images removed

Upload: others

Post on 25-Feb-2021

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley

Acceleration of Time Integration

1

Research sponsored by the Laboratory Directed Research and Development Program of Oak Ridge National Laboratory (ORNL), managed by UT-Battelle, LLC for the U. S. Department of Energy under Contract No. DE-AC05-00OR22725.

This research used resources of the National Center for Computational Sciences at Oak Ridge National Laboratory, which is supported by the Office of Science of the U.S. Department of Energy under Contract No. DE-AC05-00OR22725.

edited version, with extra images removed

Page 2: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

2

Lawrence Buja, NCARClimate Models: From IPCC to PetascaleKeynote for 2007 NCCS User Meeting

Motivation:

Higher resolution

Page 3: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

3

5/2/08 3:31 PMfinland - Google Maps

Page 1 of 1http://maps.google.com/maps?f=q&hl=en&geocode=&q=finland&ie=UTF8&ll=60.201616,24.851074&spn=2.571723,5.306396&t=p&z=7&pw=2

Address Finland

300 km

current climate models

Page 4: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

4

http://www.geo-prose.com/projects/pdfs/petascale_science.pdf

“More importantly, because the assumptions that are made in the development of parameterizations of convective clouds and the planetary boundary layer are seldom satisfied, the atmospheric component model must have sufficient resolution to dispense with these parameterizations. This would require a horizontal resolution of 1 km.”

Page 5: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

5

5/2/08 4:00 PMKatajanokanlaituri 6, 00160 Helsinki, finland - Google Maps

Page 1 of 1http://maps.google.com/maps?f=q&hl=en&geocode=&q=Katajanokanla…ie=UTF8&ll=60.166899,24.962826&spn=0.020111,0.041456&z=14&pw=2

Address Katajanokanlaituri00160 HelsinkiFinland

©2008 Google - Map data ©2008 Tele Atlas - Terms of Use

1 km

Page 6: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

6

TIME BARRIERCurrent climate models use explicit time integration

If resolution goes up

the time step must go down!

Page 7: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

7

300 km

current climate models

20 minutes

Page 8: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

8

1 km

4 seconds!

Page 9: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

9

Extreme-scale systems will provide unprecedented parallelism!

Page 10: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

10

Butperformance of individual processes has stagnated

4-secondtime step...

multi-century simulation?

Page 11: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

Fast ForwardOvercoming the time barrier

11

• Fully implicit time integration- Stable for big time steps

• Parallel in time- Time is the biggest dimension

• New discretizations- Better time accuracy

one metaphor just isn’t enough

Page 12: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

How to build a new climate model

12

1. Start with shallow-water equations on the sphere

They mimic full equations for atmosphere and ocean

Page 13: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

2. Prove yourself on standard tests

13

Defined by Williamson, Drake, Hack, Jakob, and Swarztrauber in 1992 (148 citations)

How to build a new climate model

Page 14: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

How to build a new climate model

14

3. Proceed to 3D tests and inclusion in a full model

That’s all there is to it!

Page 15: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

Fast ForwardOvercoming the time barrier

15

• Fully implicit time integration- Stable for big time steps

• Parallel in time- Time is the biggest dimension

• New discretizations- Better time accuracy

one metaphor just isn’t enough

Page 16: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

Explicit versus implicit

16

yState of simulation

at current timeValues are known

y′State of simulationat next time step

Values are unknown

y′ = f(y)Explicit

Compute unknown directly from known

Page 17: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

Explicit good and bad

• Good- Highly parallel- Nearest-neighbor communication

• Bad- Numerically unstable (blows up) for ∆t > O(∆x)- Increase resolution → decrease ∆x → decrease ∆t

17

Page 18: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

Explicit versus implicit

18

yState of simulation

at current timeValues are known

y′State of simulationat next time step

Values are unknown

y′= ay+f(y′)Implicit

Solve a (nonlinear) system of equations

Page 19: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

Implicit bad and good

• Bad- Must solve a (nonlinear) system of equations

• Good- Numerically stable for arbitrary time steps

• Ugly- Still need to worry about accuracy (for big time steps)

19

Page 20: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

Implicit + shallow water(Kate Evans)

• Start with HOMME shallow-water code• Convert explicit formulation to implicit• Solve with Trilinos

20

Page 21: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

HOMME

• High-Order-Method Modeling Environment• Principal developers

- NCAR: John Dennis, Jim Edwards, Rory Kelly, Ram Nair, Amik St-Cyr

- Sandia: Mark Taylor • Cubed-sphere grid• Spectral-element formulation (and others)• Shallow-water equations (and others)

21

image courtesy of Mark Taylor

Page 22: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

Jacobian-Free Newton Krylov (JFNK)

22

Page 23: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

Jacobian-Free Newton Krylov• What we want: F(y)=0• What we have: F(y)≠0• Find the change in F as y changes- Jacobian, J, derivative of a vector

• Approximate correction: F(y+∆y)=00=F(y+∆y)≈F(y)+J∆yF(y)=-J∆y

• Solve the linear system for ∆y and add to y• Repeat until F(y)≈0

23

Page 24: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

Jacobian-Free Newton Krylov• F(y)=-J∆y• Solve for ∆y using an iterative linear solver

• Krylov subspace methods- Take a guess at ∆y- Calculate how bad it is (residual)- Use residual to improve guess- Iterate, using past residuals and

Russian Navy know-how to improve guess- Stop when residual is small (guess is good)

24

Page 25: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

Jacobian-Free Newton Krylov

• Don’t compute the Jacobian• Approximate it using finite differencesJ∆y≈(F(y+ε∆y)-F(y))/εε is a small number

• Can be much cheaper to calculate, only need F

25

Page 26: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

Test case 1: cosine bellinitial condition

26

Page 27: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

Test case 1: cosine bellexplicit solver with “hyperviscosity”

27

Page 28: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

Test case 1: cosine bellimplicit solver, no preservatives

28

Page 29: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

Test case 1: cosine bellimplicit versus explicit

• Implicit takes many iterations per time step• But 2-hour time step instead of 2-minute• Similar error at the end• 40% shorter runtime (no preconditioner)

29

Performance result #1!

Page 30: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

Test case 2: steady state

• 12 simulated days• Explicit

- 4-minute time step- 28s runtime

• Implicit- 12-day time step- 3.6s runtime

30

Performance result #2!

Page 31: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

Fast ForwardOvercoming the time barrier

31

• Fully implicit time integration- Stable for big time steps

• Parallel in time- Time is the biggest dimension

• New discretizations- Better time accuracy

one metaphor just isn’t enough

Page 32: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

Parareal(my interest)

• Algorithm published in 2001 by Jacques-Louis Lions, Yvon Maday, and Gabriel Turinici

• Variants successful for range of applications- Navier-Stokes- Structural dynamics- Reservoir simulation

32

Page 33: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

Parareal

33

to t1 t2 t3

Y(x)

tN . . .

. . .

Solve serially at coarse time steps

Page 34: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

Parareal

34

to t1 t2 t3

Y(x)

tN . . .

. . .

Compute fine time integrations between coarse steps in parallel

Page 35: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

Parareal

35

to t1 t2 t3

Y(x)

∆1

∆2

∆3

tN . . .

. . .∆N

Propagate and accumulate fine-time corrections at coarse scale

Page 36: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

Parareal

36

• Iterate until corrections are negligible• Published results by others: 2-3 iterations

Page 37: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

My parareal experience

37

• Numerically unstable for pure advection• Confirms theoretical result by Maday and colleagues

• Should work for Burgers’ equation

∂u

∂t+ v

∂u

∂x= 0

∂u

∂t+ u

∂u

∂x− ν

∂2u

∂x2= 0X ?

Page 38: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

Fast ForwardOvercoming the time barrier

38

• Fully implicit time integration- Stable for big time steps

• Parallel in time- Time is the biggest dimension

• New discretizations- Better time accuracy

one metaphor just isn’t enough

Page 39: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

Curvelets(Rick Archibald)

• Compact in space(like finite elements)

• Preserve shape(like Fourier waves)

• Might allow Δt ~ Δx1/2

39

Page 40: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

Curvelets

40

But they require a periodic domain

Page 41: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

Multi-wavelets(Rick Archibald)

• Adaptive• Designed for refinement• Strong error bounds

- Control refinement and coarsening• Requires integral formulation

- Translation: more theoretical work to do• Work just getting started

41

Page 42: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

Finite differences(my interest)

42

Page 43: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

High-order single-step time integration

43

Consider advection:

∂u

∂t+ v

∂u

∂x= 0

Time integration using a Taylor series in small ∆t

u = u′− ∆t

∂u′

∂t+

∆t2

2

∂2u′

∂t2−

∆t3

6

∂3u′

∂t3+ O(∆t

4)

Implicit

Page 44: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

High-order single-step time integration

• Replace time derivatives with space derivatives

• Why? Many grid points in space, few in time (2)So you can form high-order space derivatives

• How? Use the governing equation

44

∂u′

∂t+ v

∂u′

∂x= 0

∂u′

∂t= −v

∂u′

∂x→

Page 45: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

High-order single-step time integration

• Got high-order space derivatives?• Get high accuracy in time for free*!• Just 2 points in time: this one and next one

- Save memory- Save I/O storage space and bandwidth- Easy startup from initial condition

45

* Since flops are free.

u = u′ + v∆t

∂u′

∂x+

v2∆t2

2

∂2u′

∂x2+

v3∆t3

6

∂3u′

∂x3+ O(∆t

4)

Page 46: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

High-order single-step time integration

• Explicit and implicit work for advection• Explicit works for Burgers’ equation • Implicit and semi-implicit for Burgers’ under development

• Goal is shallow-water equations

46

Page 47: Acceleration of Time Integration Print · 2010. 8. 11. · Rick Archibald, John Drake, Kate Evans, Doug Kothe, Trey White, Pat Worley Acceleration of Time Integration 1 Research sponsored

Would you believe I cut some topics from the talk?

• High-order methods for compact stencils• Single-cycle multi-level linear solvers

47