scholarly journals A Domain Specific Embedded Language in C++ for Automatic Differentiation, Projection, Integration and Variational Formulations

2006 ◽  
Vol 14 (2) ◽  
pp. 81-110 ◽  
Author(s):  
Christophe Prud'homme

In this article, we present a domain specific embedded language inC++ that can be used in various contexts such as numerical projection onto a functional space, numerical integration, variational formulations and automatic differentiation. Albeit these tools operate in different ways, the language overcomes this difficulty by decoupling expression constructions from evaluation. The language is implemented using expression templates and meta-programming techniques and uses various Boost libraries. The language is exercised on a number of non-trivial examples and a benchmark presents the performance behavior on a few test problems.

2015 ◽  
Vol 2015 ◽  
pp. 1-22
Author(s):  
Bart Janssens ◽  
Támas Bányai ◽  
Karim Limam ◽  
Walter Bosschaerts

In finite element methods, numerical simulation of the problem requires the generation of a linear system based on an integral form of a problem. Using C++ meta-programming techniques, a method is developed that allows writing code that stays close to the mathematical formulation. We explain the specifics of our method, which relies on the Boost.Proto framework to simplify the evaluation of our language. Some practical examples are elaborated, together with an analysis of the performance. The abstraction overhead is quantified using benchmarks.


1999 ◽  
Vol 9 (5) ◽  
pp. 483-525 ◽  
Author(s):  
PETER THIEMANN

We present a general method to transform a compositional specification of a specializer for a functional programming language into a set of combinators that can be used to perform the same specialization more efficiently. The main transformation steps are the transition to higher-order abstract syntax and untagging. All transformation steps are proved correct. The resulting combinators can be implemented in any functional language, typed or untyped, pure or impure. They may also be considered as forming a domain-specific language for meta-programming. We demonstrate the generality of the method by applying it to several specializers of increasing strength. We demonstrate its efficiency by comparing it with a traditional specialization system based on self-application.


2021 ◽  
Author(s):  
Yuxuan Jing ◽  
Rami M. Younis

Abstract Automatic differentiation software libraries augment arithmetic operations with their derivatives, thereby relieving the programmer of deriving, implementing, debugging, and maintaining derivative code. With this encapsulation however, the responsibility of code optimization relies more heavily on the AD system itself (as opposed to the programmer and the compiler). Moreover, given that there are multiple contexts in reservoir simulation software for which derivatives are required (e.g. property package and discrete operator evaluations), the AD infrastructure must also be adaptable. An Operator Overloading AD design is proposed and tested to provide scalability and computational efficiency seemlessly across memory- and compute-bound applications. This is achieved by 1) use of portable and standard programming language constructs (C++17 and OpenMP 4.5 standards), 2) adopting a vectorized programming interface, 3) lazy evaluation via expression templates, and 4) multiple memory alignment and layout policies. Empirical analysis is conducted on various kernels spanning various arithmetic intensity and working set sizes. Cache- aware roofline analysis results show that the performance and scalability attained are reliably ideal. In terms of floapting point operations executed per second, the performance of the AD system matches optimized hand-code. Finally, the implementation is benchmarked using the Automatically Differentiable Expression Templates Library (ADETL).


2013 ◽  
Vol 135 (6) ◽  
Author(s):  
Malcolm J. Andrews

Local sensitivities are explored using dual-number-automatic-differentiation (DNAD) across three mathematical models of physical systems that have increasing complexity. The models are: (1) a model for the approach of a sphere to free fall; (2) the Taylor-analogy-breakup (TAB) model for liquid droplet atomization; and, (3) an evaluation of the BHR model of turbulence for the development of one-dimensional Rayleigh–Taylor driven material mixing. Sensitivity and functional shape parameters are developed that permit a relative study to be quickly performed for each model. Furthermore, compensating errors, measurement parameter sensitivity, and feature sensitivities are investigated. The test problems consider transient (initial condition effects), steady state (final functional forms), and measures of functional shape. Reduced model forms are explored and selected according to sensitivity. Aside from the local sensitivity studies of the models and associated results, DNAD is shown to be one of several useful, quickly implemented tools to investigate a variety of sensitivity effects in models and together with the present results may serve as a means to simplify a model or focus future model developments and associated experiments.


Sign in / Sign up

Export Citation Format

Share Document