OpenAD - Templating/Inlining
Adjoints can be computed according to a variety of schemes the most
common of which are called split
and joint reversal
scheme. Here we assume the granularity of a subroutine (one can
always wrap a certain code section in a subroutine). The reversal
schemes rely on a particular combination of variations of code
generated from a subroutine body which accomplish specific tasks:
- plain forward run (the original code)
- argument or result checkpoint storing or restoring
- taping intermediate values for a subsequent reversal
- adjoin the subroutine
A quick solution that achieves a high flexibility for constructing
these reversal schemes the code implementing the schemes is the
templating feature. The template is written in the target programming
language and therefore easier to modifiy than code generation
implemented in xaifBooster. The template is contained in a file
specified to the postprocessor via the
... flag. The default name for this file is ad_template.f
A more detailed explanation of the mechanism can be found in [FILL THIS
IN].
Inlining is nothing more than expansion of inlinable subroutines that -
in conjucntion with the code found in the template - takes the burden
of generating simple but highly repetitive code from xaifBooster.
The inlinable subroutines are defined in the target language and the
inlining is done by the postprocessor
that reads the definition from the file specified by the .... flag or
by default from ad_inline.f.