Parallelisable adjoint stencil computations using transposed forward-mode algorithmic differentiation
Optimisation Methods and Software
MetadataShow full item record
Reverse-mode algorithmic differentiation 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 optimisation, 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 algorithmic differentiation tools, and previously shown methods achieve poor scalability of the derivative code. We present the algorithmic differentiation of an OpenMP-parallelised finite volume compressible flow solver for unstructured meshes. Our approach enables us to reuse the parallelisation 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 parallelisation 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-size CFD codes, and produces more efficient adjoint derivative code than previously shown algorithmic differentiation methods.