# Reverse-Mode Algorithmic Differentiation of an OpenMP-Parallel Compressible Flow Solver

## Abstract

y Reverse-mode algorithmic differentiation (AD) is an established method for obtaining adjoint derivatives of computer simulation applications. In computational fluid dynamics (CFD), adjoint derivatives of a cost function output such as drag or lift with respect to design parameters such as surface coordinates or geometry control points are a key ingredient for shape optimization, uncertainty quantification and flow control. The computational cost of CFD applications and their derivatives makes it essential to use high-performance computing hardware efficiently, including multi- and many-core architectures. Nevertheless, OpenMP is not supported in most AD tools, and previously shown methods achieve poor scalability of the derivative code. We present the AD of an OpenMP-parallelized finite volume compressible flow solver for unstructured meshes. Our approach enables us to reuse the parallelization of the original code in the computation of adjoint derivatives. The method works by identifying code segments that can be differentiated in reverse-mode without changing their memory access pattern. The OpenMP parallelization is integrated into the derivative code during the build process in a way that is robust to modifications of the original code and independent of the OpenMP support of the differentiation tool. We show the scalability of our adjoint CFD solver on testmore »

- Authors:

- Publication Date:

- Research Org.:
- Argonne National Lab. (ANL), Argonne, IL (United States)

- Sponsoring Org.:
- USDOE Office of Science (SC); USDOE Office of Science - Office of Advanced Scientific Computing Research; European Commission - Community Research and Development Information Service (CORDIS) - Seventh Framework Programme (FP7)

- OSTI Identifier:
- 1510005

- DOE Contract Number:
- AC02-06CH11357

- Resource Type:
- Journal Article

- Journal Name:
- International Journal of High Performance Computing Applications

- Additional Journal Information:
- Journal Volume: 33; Journal Issue: 1

- Country of Publication:
- United States

- Language:
- English

### Citation Formats

```
Huckelheim, Jan, Hovland, Paul, Strout, Michelle Mills, and Muller, Jens-Dominik.
```*Reverse-Mode Algorithmic Differentiation of an OpenMP-Parallel Compressible Flow Solver*. United States: N. p., 2019.
Web. doi:10.1177/1094342017712060.

```
Huckelheim, Jan, Hovland, Paul, Strout, Michelle Mills, & Muller, Jens-Dominik.
```*Reverse-Mode Algorithmic Differentiation of an OpenMP-Parallel Compressible Flow Solver*. United States. doi:10.1177/1094342017712060.

```
Huckelheim, Jan, Hovland, Paul, Strout, Michelle Mills, and Muller, Jens-Dominik. Tue .
"Reverse-Mode Algorithmic Differentiation of an OpenMP-Parallel Compressible Flow Solver". United States. doi:10.1177/1094342017712060.
```

```
@article{osti_1510005,
```

title = {Reverse-Mode Algorithmic Differentiation of an OpenMP-Parallel Compressible Flow Solver},

author = {Huckelheim, Jan and Hovland, Paul and Strout, Michelle Mills and Muller, Jens-Dominik},

abstractNote = {y Reverse-mode algorithmic differentiation (AD) is an established method for obtaining adjoint derivatives of computer simulation applications. In computational fluid dynamics (CFD), adjoint derivatives of a cost function output such as drag or lift with respect to design parameters such as surface coordinates or geometry control points are a key ingredient for shape optimization, uncertainty quantification and flow control. The computational cost of CFD applications and their derivatives makes it essential to use high-performance computing hardware efficiently, including multi- and many-core architectures. Nevertheless, OpenMP is not supported in most AD tools, and previously shown methods achieve poor scalability of the derivative code. We present the AD of an OpenMP-parallelized finite volume compressible flow solver for unstructured meshes. Our approach enables us to reuse the parallelization of the original code in the computation of adjoint derivatives. The method works by identifying code segments that can be differentiated in reverse-mode without changing their memory access pattern. The OpenMP parallelization is integrated into the derivative code during the build process in a way that is robust to modifications of the original code and independent of the OpenMP support of the differentiation tool. We show the scalability of our adjoint CFD solver on test cases ranging from thousands to millions of finite volume mesh cells on CPUs with up to 16 threads as well as on an Intel XeonPhi card with 236 threads. We demonstrate that our approach is more practical to implement for production-sized CFD codes and produces more efficient adjoint derivative code than previously shown AD methods.},

doi = {10.1177/1094342017712060},

journal = {International Journal of High Performance Computing Applications},

number = 1,

volume = 33,

place = {United States},

year = {2019},

month = {1}

}