-
Notifications
You must be signed in to change notification settings - Fork 7
/
20130904-BOUTPETSc.tex
294 lines (255 loc) · 9 KB
/
20130904-BOUTPETSc.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
% \documentclass[handout]{beamer}
\documentclass{beamer}
\mode<presentation>
{
\usetheme{ANLBlue}
% \usefonttheme[onlymath]{serif}
% \usetheme{Singapore}
% \usetheme{Warsaw}
% \usetheme{Malmoe}
% \useinnertheme{circles}
% \useoutertheme{infolines}
% \useinnertheme{rounded}
\setbeamercovered{transparent=20}
}
\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage{alltt,listings,multirow,ulem,siunitx}
\usepackage[absolute,overlay]{textpos}
\TPGrid{1}{1}
\usepackage{pdfpages}
\usepackage{ulem}
\usepackage{multimedia}
\usepackage{multicol}
\newcommand\hmmax{0}
\newcommand\bmmax{0}
\usepackage{bm}
\usepackage{comment}
% font definitions, try \usepackage{ae} instead of the following
% three lines if you don't like this look
\usepackage{mathptmx}
\usepackage[scaled=.90]{helvet}
% \usepackage{courier}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{shadows,arrows,shapes.misc,shapes.arrows,shapes.multipart,arrows,decorations.pathmorphing,backgrounds,positioning,fit,petri,calc,shadows,chains,matrix}
% \usepackage{pgfpages}
% \pgfpagesuselayout{4 on 1}[a4paper,landscape,border shrink=5mm]
\usepackage{JedMacros}
\newcommand{\timeR}{t_{\mathrm{R}}}
\newcommand{\timeW}{t_{\mathrm{W}}}
\newcommand{\mglevel}{\ensuremath{\ell}}
\newcommand{\mglevelcp}{\ensuremath{\mglevel_{\mathrm{cp}}}}
\newcommand{\mglevelcoarse}{\ensuremath{\mglevel_{\mathrm{coarse}}}}
\newcommand{\mglevelfine}{\ensuremath{\mglevel_{\mathrm{fine}}}}
%solution and residual
\newcommand{\vx}{\ensuremath{x}}
\newcommand{\vc}{\ensuremath{\hat{x}}}
\newcommand{\vr}{\ensuremath{r}}
\newcommand{\vb}{\ensuremath{b}}
%operators
\newcommand{\vA}{\ensuremath{A}}
\newcommand{\vP}{\ensuremath{I_H^h}}
\newcommand{\vS}{\ensuremath{S}}
\newcommand{\vR}{\ensuremath{I_h^H}}
\newcommand{\vI}{\ensuremath{\hat I_h^H}}
\newcommand{\vV}{\ensuremath{\mathbf{V}}}
\newcommand{\vF}{\ensuremath{F}}
\newcommand{\vtau}{\ensuremath{\mathbf{\tau}}}
\title{PETSc and BOUT++}
\author{{\bf Jed Brown} \\
Peter Brune, Emil Constantinescu, \\
Debojyoti Ghosh, Lois Curfman McInnes \\
\texttt{\{jedbrown,brune,emconsta,ghosh,curfman\}@mcs.anl.gov}
}
% - Use the \inst command only if there are several affiliations.
% - Keep it simple, no one is interested in your street address.
\institute
{
Mathematics and Computer Science Division \\ Argonne National Laboratory
}
\date{BOUT++ Workshop, 2013-09-04}
% This is only inserted into the PDF information catalog. Can be left
% out.
\subject{Talks}
% If you have a file called "university-logo-filename.xxx", where xxx
% is a graphic format that can be processed by latex or pdflatex,
% resp., then you can add a logo as follows:
% \pgfdeclareimage[height=0.5cm]{university-logo}{university-logo-filename}
% \logo{\pgfuseimage{university-logo}}
% Delete this, if you do not want the table of contents to pop up at
% the beginning of each subsection:
% \AtBeginSubsection[]
% {
% \begin{frame}<beamer>
% \frametitle{Outline}
% \tableofcontents[currentsection,currentsubsection]
% \end{frame}
% }
\AtBeginSection[]
{
\begin{frame}<beamer>
\frametitle{Outline}
\tableofcontents[currentsection]
\end{frame}
}
% If you wish to uncover everything in a step-wise fashion, uncomment
% the following command:
% \beamerdefaultoverlayspecification{<+->}
\begin{document}
\lstset{language=C}
\normalem
\begin{frame}
\titlepage
\end{frame}
\begin{frame}{Portable {\bf Extensible} Toolkit for Scientific computing}
\begin{block}{Philosophy: Everything has a plugin architecture}
\begin{itemize}
\item Vectors, Matrices, Coloring/ordering/partitioning algorithms
\item Preconditioners, Krylov accelerators
\item Nonlinear solvers, Time integrators
\item Spatial discretizations/topology$^*$
\end{itemize}
\end{block}
\begin{example}
Vendor supplies matrix format and associated preconditioner, distributes
compiled shared library. Application user loads plugin at runtime, no source
code in sight.
\end{example}
\end{frame}
\begin{frame}{Portable Extensible {\bf Toolkit} for Scientific computing}
Algorithms, (parallel) debugging aids, low-overhead profiling
\begin{block}{Composability}
Try new algorithms by choosing from product space and composing
existing algorithms (multilevel, domain decomposition, splitting).
\end{block}
\begin{block}{Experimentation}
\begin{itemize}
\item It is not possible to pick the solver \emph{a priori}. \\
What will deliver best/competitive performance for a given physics, discretization, architecture, and problem size?
\item PETSc's response: expose an algebra of composition so new solvers can be created at runtime.
\item Important to keep solvers decoupled from physics and discretization because we also experiment with those.
\end{itemize}
\end{block}
\end{frame}
\section{Time Integration}
\begin{frame}{Trade-offs in time integration}
\begin{itemize}
\item Properties
\begin{itemize}
\item Nonlinear stability (e.g., positivity preservation)
\item Stability along imaginary axis
\item $L$-stability (damping at infinity)
\item Implicitness and reuse
\end{itemize}
\item What is expensive?
\begin{itemize}
\item Function evaluation
\item Operator assembly/preconditioner setup
\begin{itemize}
\item How much can be reused for how long?
\end{itemize}
\item Implicit solves
\begin{itemize}
\item Can we find better solver algorithm?
\item More effort in setup?
\end{itemize}
\end{itemize}
\item What is ``convergence''?
\begin{itemize}
\item Wave propagation: implicitness useless for convergence \emph{in a norm}
\item Non-norm functionals could be robust
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}{Reusing implicit solver setup}
\begin{itemize}
\item Linearization
\item MG interpolants
\item Lagged preconditioner
\item Modified Newton
\item Quasi-Newton
\item IMEX with linear implicit part
\item Rosenbrock/W
\end{itemize}
\end{frame}
\input{slides/PETSc/TSARKIMEX.tex}
% \input{slides/PETSc/TSUsage.tex}
%\input{slides/TS/}
\begin{frame}[fragile]{Time integration method design}
\begin{figure}
\centering
\includegraphics[width=.8\textwidth]{figures/TS/EmilMethodDesignFeatures.png}
\end{figure}
\begin{itemize}
\item Select order, number of stages, required properties
\item Optimize properties like SSP coefficient, accuracy, or linear stability
\item \cverb|TSARKIMEXRegister("my-method", ...coefficients...)|
\item \cverb|-ts_type arkimex -ts_arkimex_type my-method|
\end{itemize}
\end{frame}
\begin{frame}{Example: Additive Runge-Kutta design}
\begin{itemize}
\item 3-stage, second order, $L$-stable implicit part
\item one-parameter family of solutions
\end{itemize}
\begin{description}
\item[ARK2c] Maximize SSP coefficient
\item[ARK2E] Minimize leading error coefficient
\end{description}
\begin{figure}
\centering
\includegraphics[width=0.55\textwidth]{figures/TS/ssp_ark_poster.png}
\includegraphics[width=0.49\textwidth]{figures/TS/Stability_ARK2E_ARK2C.pdf}
\end{figure}
\end{frame}
\input{slides/PETSc/TSMethods.tex}
\begin{frame}{Adaptive controllers}
\begin{itemize}
\item ``Stiff'' waves are not stiff if one wants to converge \emph{in a norm}
\item PETSc integrators provide embedded methods to estimate errors
\item Automatic controllers optimize local truncation error and nonlinear solve cost
\item User can register custom controllers
\item Use a priori knowledge of the physics, robust functionals
\item Choose from list of methods, choose next step size
\end{itemize}
\end{frame}
\section{Nonlinear solvers}
\begin{frame}{Which nonlinear solver?}
\begin{itemize}
\item Global linearization (NewtonLS, NewtonTR)
\begin{itemize}
\item Preconditioning libraries for assembled matrices
\item Low arithmetic intensity
\end{itemize}
\item Quasi-Newton
\begin{itemize}
\item Build low-rank updates to Jacobian inverse
\item Brown and Brune, ``Low-rank quasi-Newton updates for robust Jacobian lagging in Newton-type methods'', ANS MC13.
\end{itemize}
\item Nonlinear multigrid and domain decomposition
\begin{itemize}
\item ASPIN (left-preconditioned nonlinear Schwarz), also right-preconditioned
\item Full Approximation Scheme with linear or nonlinear smoothers
\item More intrusive, but freakishly efficient for difficult problems
\end{itemize}
\item Nonlinear GMRES, Anderson mixing, nonlinear CG
\begin{itemize}
\item Accelerator for nonlinear preconditioning
\item Good alternative to matrix-free finite differencing
\item More robust line search possible: operates in reduced basis
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}
\includegraphics[width=\textwidth]{figures/BruneNGMRESFAS2.png}
\end{frame}
\input{slides/MonolithicOrSplit.tex}
\input{slides/PETSc/LocalSpaces.tex}
\section{Comments on performance}
\input{slides/JFNKBottlenecks.tex}
\input{slides/ScalabilityWarning.tex}
\input{slides/Dohp/TensorVsAssembly.tex}
\input{slides/HardwareArithmeticIntensity.tex}
\end{document}