Efficient reversal of the intraprocedural flow of control in adjoint computations

被引:3
作者
Utke, Jean
Lyons, Andrew
Naumann, Uwe
机构
[1] Argonne Natl Lab, Div Math & Comp Sci, Argonne, IL 60438 USA
[2] Rhein Westfal TH Aachen, Software & Tools Computat Engn, D-52056 Aachen, Germany
基金
美国国家科学基金会;
关键词
control flow reversal; adjoint computation; efficient loop reversal;
D O I
10.1016/j.jss.2006.02.038
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Numerical simulations of physical, chemical, and economical processes play an increasingly important role in modern science and engineering. The implementation of mathematical models of real-world applications on a computer facilitates both the speed and the depth of our understanding of the behavior of the respective systems. Derivative models of the computer programs are required to make the transition from pure simulation to the highly desirable optimization of the numerical models with respect to a potentially very large number of input parameters. Such models can be generated automatically from the given numerical program by a source transformation technique known as automatic differentiation. Reversal of the control flow is especially important for the generation of adjoint derivative models. We describe an approach to the control flow reversal of structured programs motivated by the significant weakness of approaches that do not exploit the result of control-flow analysis. Our approach is used to automatically generate adjoint code for numerical programs by semantic source transformation. After a short introduction to applications and the implementation tool set, we motivate the proposed approach with a simple example. We present a novel preaccumulation algorithm for local Jacobian matrices at the level of basic blocks. The main part of the paper covers the reversal of structured control flow graphs. First we show the algorithmic steps for simple branches and loops. We give a detailed algorithm for the reversal of arbitrary combinations of loops and branches based only on the structural information in a general control flow graph. Dependencies between computations and their enclosing control flow constructs can lead to inefficient adjoint code. We formulate a set of conditions that allows for considerable efficiency gains in the adjoint code while permitting a reasonably simple modification of the reversal algorithms for specially designated control flow subgraphs. We present a sensitivity computation of an oceanographic application that illustrates the benefits of this modified approach. (C) 2006 Elsevier Inc. All rights reserved.
引用
收藏
页码:1280 / 1294
页数:15
相关论文
共 28 条
[1]   DEBUGGING WITH DYNAMIC SLICING AND BACKTRACKING [J].
AGRAWAL, H ;
DEMILLO, RA ;
SPAFFORD, EH .
SOFTWARE-PRACTICE & EXPERIENCE, 1993, 23 (06) :589-616
[2]  
Aho Alfred V., 1972, The theory of parsing, translation, and compiling
[3]  
Albrecht A, 2003, LECT NOTES COMPUT SC, V2658, P575
[4]  
[Anonymous], 2000, FRONTIERS APPL MATH
[5]  
Berz M., 1996, COMPUTATIONAL DIFFER
[6]  
BJORCK A, 1990, HDB NUMERICAL ANAL, V1
[7]  
BUCKER HM, 2005, LECT NOTES COMPUTATI, V50
[8]  
Corliss G., 2002, AUTOMATIC DIFFERENTI
[9]  
FAGAN M, 2003, CAAMTR0316 RIC U DEP
[10]   BEYOND INDUCTION VARIABLES - DETECTING AND CLASSIFYING SEQUENCES USING A DEMAND-DRIVEN SSA FORM [J].
GERLEK, MP ;
STOLTZ, E ;
WOLFE, M .
ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 1995, 17 (01) :85-122