# SC²S Colloquium - April 9, 2015

Date: |
April 9, 2015 |

Room: |
02.07.023 |

Time: |
10:30 am, s.t. |

Invited by: |
Univ.-Prof. Dr. Michael Bader |

## Contents

## Angelika Schwarz: Exploiting Compiler Optimization on Efficient Adjoint Code Generated from Linearized Directed Acyclic Graphs

### Motivation

The evaluation of derivatives is frequently a crucial component in numerical computing. Examples include the solution of systems of nonlinear equations and partial differential equations. Moreover, derivatives are ubiquitous in sensitivity analysis, inverse problems and multidisciplinary design optimization. In many applications, the computation of derivatives constitutes a substantial computational burden. Thus, it is desirable to minimize the memory demand and time spent on the computation of the derivatives. Furthermore, the accuracy at which the derivatives are computed may impact the convergence behavior and the runtime. Algorithmic differentiation (AD) is a technique for computing derivatives which addresses both the demand for accuracy and the reduction of the computational cost.

### Methodology

The implemented code generator reads in C++ code and generates optimized first-order derivative source code. Internally, the code generator employs the vertex elimination AD approach, which allows the code generator to freely exploit program structures. The code generator’s output files exhibit a simple structure, which is well-suited to make the compiler maximize the performance of the derivative code.

### Employment

The two-step optimization procedure of first vertex elimination and then compiler optimization promises to generate highly efficient adjoint code. As such, the code generator qualifies itself for being used as a supplement to classical AD tools, in particular to those which use operator overloading. Rather than differentiating a program entirely with AD by operator overloading, certain computationally expensive code segments can be outsourced. The derivative computation of these outsourced code segments is then superseded with the code generator’s output. A test case demonstrates the feasibility of this approach using the AD tool dco/c++.

### Agenda

- brief introduction to AD
- relate vertex elimination AD to the traditional forward and reverse mode AD
- mechanics of the code generator
- effectiveness of compiler optimization on the code generator’s output
- race: dco/c++ vs. combined usage of dco/c++ and the code generator