Second Order Adjoints with the NAG Fortran 95 Compiler
Uwe Naumann, Michael Maier RWTH Aachen, Germany Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, UK riehme@stce.rwth-aachen.de May 22, 2007
Second Order Adjoints with the NAG Fortran 95 Compiler Uwe Naumann, - - PowerPoint PPT Presentation
Second Order Adjoints with the NAG Fortran 95 Compiler Uwe Naumann, Michael Maier RWTH Aachen, Germany Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, UK riehme@stce.rwth-aachen.de May 22, 2007 Outline COMPAD-II
Uwe Naumann, Michael Maier RWTH Aachen, Germany Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, UK riehme@stce.rwth-aachen.de May 22, 2007
1
COMPAD-II
2
Tangent linear mode by parsetree manipulation
3
Adjoint code generation
4
Second Order Adjoints
6
Outlook
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 2 / 29
Followup of COMPAD-I project (2002-2004) Funded be EPSRC and QinetiQ Duration : 2006/10 – 2008/10 2 full time (Dima, me) + 1 student (Micheal) Target (A): COMPAD : Compiler AD / Adjoints
robust adjoint compiler based on the NAGWare Fortran 95 compiler simple checkpointing of loops
Target (B) : ADAC : Automatic Differentiation of Assembler Code
differentiate a top-level function given as assembler code control file specifies independent and dependend variables coupling with NAGWare Fortran 95 compiler to get second order adjoints based on source transformation only but this is the sound of the future
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 3 / 29
Followup of COMPAD-I project (2002-2004) Funded be EPSRC and QinetiQ Duration : 2006/10 – 2008/10 2 full time (Dima, me) + 1 student (Micheal) Target (A): COMPAD : Compiler AD / Adjoints
robust adjoint compiler based on the NAGWare Fortran 95 compiler simple checkpointing of loops
Target (B) : ADAC : Automatic Differentiation of Assembler Code
differentiate a top-level function given as assembler code control file specifies independent and dependend variables coupling with NAGWare Fortran 95 compiler to get second order adjoints based on source transformation only but this is the sound of the future
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 3 / 29
Followup of COMPAD-I project (2002-2004) Funded be EPSRC and QinetiQ Duration : 2006/10 – 2008/10 2 full time (Dima, me) + 1 student (Micheal) Target (A): COMPAD : Compiler AD / Adjoints
robust adjoint compiler based on the NAGWare Fortran 95 compiler simple checkpointing of loops
Target (B) : ADAC : Automatic Differentiation of Assembler Code
differentiate a top-level function given as assembler code control file specifies independent and dependend variables coupling with NAGWare Fortran 95 compiler to get second order adjoints based on source transformation only but this is the sound of the future
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 3 / 29
Modified NAGWare Fortran 95 compiler with builtin AD Provide a (couple of) COMPAD MODULE (s) defining a COMPAD TYPE Any source code compiled with the a -ad flag get differentiated, no special top-level routine, no changes required by the user passive driver program, explicitely using a COMPAD MODULE, all active variables have to be of COMPAD TYPE Two modes: Tangent linear mode by compiler generated overloading adjoint mode with compiler generated adjoint code (source trafo) Two flavors each selected by choosing a specific COMPAD MODULE: pure mode with scalar adjoints derived mode where values and adjoints are represented by derived types
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 4 / 29
Modified NAGWare Fortran 95 compiler with builtin AD Provide a (couple of) COMPAD MODULE (s) defining a COMPAD TYPE Any source code compiled with the a -ad flag get differentiated, no special top-level routine, no changes required by the user passive driver program, explicitely using a COMPAD MODULE, all active variables have to be of COMPAD TYPE Two modes: Tangent linear mode by compiler generated overloading adjoint mode with compiler generated adjoint code (source trafo) Two flavors each selected by choosing a specific COMPAD MODULE: pure mode with scalar adjoints derived mode where values and adjoints are represented by derived types
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 4 / 29
Modified NAGWare Fortran 95 compiler with builtin AD Provide a (couple of) COMPAD MODULE (s) defining a COMPAD TYPE Any source code compiled with the a -ad flag get differentiated, no special top-level routine, no changes required by the user passive driver program, explicitely using a COMPAD MODULE, all active variables have to be of COMPAD TYPE Two modes: Tangent linear mode by compiler generated overloading adjoint mode with compiler generated adjoint code (source trafo) Two flavors each selected by choosing a specific COMPAD MODULE: pure mode with scalar adjoints derived mode where values and adjoints are represented by derived types
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 4 / 29
For pure mode COMPAD MODULE has to provide Derived type COMPAD TYPE with double precision component val Adjoint mode: COMPAD TYPE with additional drv (double) Overloaded operators and intrinsic functions for the COMPAD TYPE A COMPAD MODULE for the derived mode has to provide COMPAD TYPE with component val of arbitrary VALUE TYPE Overloaded operators and intrinsic functions for the COMPAD TYPE Adjoint mode:
COMPAD TYPE with additional component drv of arbitrary DERIV TYPE Overloaded operators and intrinsic funcitions for the DERIV TYPE
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 5 / 29
For pure mode COMPAD MODULE has to provide Derived type COMPAD TYPE with double precision component val Adjoint mode: COMPAD TYPE with additional drv (double) Overloaded operators and intrinsic functions for the COMPAD TYPE A COMPAD MODULE for the derived mode has to provide COMPAD TYPE with component val of arbitrary VALUE TYPE Overloaded operators and intrinsic functions for the COMPAD TYPE Adjoint mode:
COMPAD TYPE with additional component drv of arbitrary DERIV TYPE Overloaded operators and intrinsic funcitions for the DERIV TYPE
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 5 / 29
Overloading mode MINPACK-II , scalar valued problems only
working, that is gradients are correct need to replace statement functions (deprecated feature) with internal subprograms by hand
CNS - code from J¨
10000 lines of Fortran 95 code uses allocatable arrays and other Fortran 95 features derivatives checked against divided differences Runtime: factor 12 with gcc and factor 4 with Intel C compiler
Adjoint mode we have just started very simple test programs (Rosenbrock function) works just one MINPACK-II problems tested / works (Elastic plastic torsion)
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 6 / 29
Overloading mode MINPACK-II , scalar valued problems only
working, that is gradients are correct need to replace statement functions (deprecated feature) with internal subprograms by hand
CNS - code from J¨
10000 lines of Fortran 95 code uses allocatable arrays and other Fortran 95 features derivatives checked against divided differences Runtime: factor 12 with gcc and factor 4 with Intel C compiler
Adjoint mode we have just started very simple test programs (Rosenbrock function) works just one MINPACK-II problems tested / works (Elastic plastic torsion)
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 6 / 29
Overloading mode MINPACK-II , scalar valued problems only
working, that is gradients are correct need to replace statement functions (deprecated feature) with internal subprograms by hand
CNS - code from J¨
10000 lines of Fortran 95 code uses allocatable arrays and other Fortran 95 features derivatives checked against divided differences Runtime: factor 12 with gcc and factor 4 with Intel C compiler
Adjoint mode we have just started very simple test programs (Rosenbrock function) works just one MINPACK-II problems tested / works (Elastic plastic torsion)
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 6 / 29
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 7 / 29
Specifying the -ad (or the -ad overload) flag of the compiler cause Generation of use - statements for a COMPAD MODULE Activate during parsing: change type of any floating point variables to COMPAD TYPE Note that we have now Association by address (in contrast to Association by name in first sourcetrafo prototype) Resolution of overloading for COMPAD TYPE is business as usual Special care has to be taken for Initialisation expressions: Create structure constructors DATA entries: encapsulate values within COMPAD TYPE constructors during semantic analysis Literal constants in calls must be encapsulated too Deactivation of floating point parameters
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 8 / 29
Specifying the -ad (or the -ad overload) flag of the compiler cause Generation of use - statements for a COMPAD MODULE Activate during parsing: change type of any floating point variables to COMPAD TYPE Note that we have now Association by address (in contrast to Association by name in first sourcetrafo prototype) Resolution of overloading for COMPAD TYPE is business as usual Special care has to be taken for Initialisation expressions: Create structure constructors DATA entries: encapsulate values within COMPAD TYPE constructors during semantic analysis Literal constants in calls must be encapsulated too Deactivation of floating point parameters
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 8 / 29
Specifying the -ad (or the -ad overload) flag of the compiler cause Generation of use - statements for a COMPAD MODULE Activate during parsing: change type of any floating point variables to COMPAD TYPE Note that we have now Association by address (in contrast to Association by name in first sourcetrafo prototype) Resolution of overloading for COMPAD TYPE is business as usual Special care has to be taken for Initialisation expressions: Create structure constructors DATA entries: encapsulate values within COMPAD TYPE constructors during semantic analysis Literal constants in calls must be encapsulated too Deactivation of floating point parameters
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 8 / 29
subroutine F(x,y) double precision :: x, y y=sin(x) end subroutine
|-ROOT \-S SUBP |-SUBROUTINE | |-NAME=F | \-LIST | |-NAME=X | \-NAME=Y |-TYPE | |-DOUBLE P | |-NAME=X | \-NAME=Y |-ASGN | |-NAME=Y | \-FUNREF | |-NAME=SIN | \-NAME=X \-END |-ROOT \-S SUBP |-SUBROUTINE | |-NAME=F | \-LIST | |-NAME=X | \-NAME=Y |-USE | \-NAME=compad module |-TYPE | |-USERTYPE | | |-NAME=COMPAD TYPE | | \-COMMENT | | |-DOUBLE P | | |-ICONST=6 | | \-ICONST=0 | |-NAME=X | \-NAME=Y |-ASGN | |-NAME=Y | \-FUNREF | |-NAME=SIN | \-NAME=X \-END
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 9 / 29
subroutine F(x,y) double precision :: x, y y=sin(x) end subroutine
|-ROOT \-S SUBP |-SUBROUTINE | |-NAME=F | \-LIST | |-NAME=X | \-NAME=Y |-TYPE | |-DOUBLE P | |-NAME=X | \-NAME=Y |-ASGN | |-NAME=Y | \-FUNREF | |-NAME=SIN | \-NAME=X \-END |-ROOT \-S SUBP |-SUBROUTINE | |-NAME=F | \-LIST | |-NAME=X | \-NAME=Y |-USE | \-NAME=compad module |-TYPE | |-USERTYPE | | |-NAME=COMPAD TYPE | | \-COMMENT | | |-DOUBLE P | | |-ICONST=6 | | \-ICONST=0 | |-NAME=X | \-NAME=Y |-ASGN | |-NAME=Y | \-FUNREF | |-NAME=SIN | \-NAME=X \-END
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 9 / 29
subroutine F(x,y) double precision :: x, y y=sin(x) end subroutine
|-ROOT \-S SUBP |-SUBROUTINE | |-NAME=F | \-LIST | |-NAME=X | \-NAME=Y |-TYPE | |-DOUBLE P | |-NAME=X | \-NAME=Y |-ASGN | |-NAME=Y | \-FUNREF | |-NAME=SIN | \-NAME=X \-END |-ROOT \-S SUBP |-SUBROUTINE | |-NAME=F | \-LIST | |-NAME=X | \-NAME=Y |-USE | \-NAME=compad module |-TYPE | |-USERTYPE | | |-NAME=COMPAD TYPE | | \-COMMENT | | |-DOUBLE P | | |-ICONST=6 | | \-ICONST=0 | |-NAME=X | \-NAME=Y |-ASGN | |-NAME=Y | \-FUNREF | |-NAME=SIN | \-NAME=X \-END
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 9 / 29
subroutine F(x,y) double precision :: x, y y=sin(x) end subroutine
|-ROOT \-S SUBP |-SUBROUTINE | |-NAME=F | \-LIST | |-NAME=X | \-NAME=Y |-TYPE | |-DOUBLE P | |-NAME=X | \-NAME=Y |-ASGN | |-NAME=Y | \-FUNREF | |-NAME=SIN | \-NAME=X \-END |-ROOT \-S SUBP |-SUBROUTINE | |-NAME=F | \-LIST | |-NAME=X | \-NAME=Y |-USE | \-NAME=compad module |-TYPE | |-USERTYPE | | |-NAME=COMPAD TYPE | | \-COMMENT | | |-DOUBLE P | | |-ICONST=6 | | \-ICONST=0 | |-NAME=X | \-NAME=Y |-ASGN | |-NAME=Y | \-FUNREF | |-NAME=SIN | \-NAME=X \-END
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 9 / 29
subroutine F(x,y) double precision :: x, y y=sin(x) end subroutine
|-ROOT \-S SUBP |-SUBROUTINE | |-NAME=F | \-LIST | |-NAME=X | \-NAME=Y |-TYPE | |-DOUBLE P | |-NAME=X | \-NAME=Y |-ASGN | |-NAME=Y | \-FUNREF | |-NAME=SIN | \-NAME=X \-END |-ROOT \-S SUBP |-SUBROUTINE | |-NAME=F | \-LIST | |-NAME=X | \-NAME=Y |-USE | \-NAME=compad module |-TYPE | |-USERTYPE | | |-NAME=COMPAD TYPE | | \-COMMENT | | |-DOUBLE P | | |-ICONST=6 | | \-ICONST=0 | |-NAME=X | \-NAME=Y |-ASGN | |-NAME=Y | \-FUNREF | |-NAME=SIN | \-NAME=X \-END
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 9 / 29
Parameter statement: real(kind=2), DIMENSION(2) :: X, P, Y PARAMETER( P = 3.14 ) When parser hits the parameter statement, P is already activated. So we have to find declaration node of P in parse tree detect original datatype of P create new declaration node with original data type copy all necessary attribute subtrees (dimension, allocatable, ..) remove P from the active declaration subtree keep parsetree consistent Parameter attribute: Much easier than parameter statement since attribute is detected before insertion of nodes into parsetree all variables declared are passive, so just restore original type
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 10 / 29
Parameter statement: real(kind=2), DIMENSION(2) :: X, P, Y PARAMETER( P = 3.14 ) When parser hits the parameter statement, P is already activated. So we have to find declaration node of P in parse tree detect original datatype of P create new declaration node with original data type copy all necessary attribute subtrees (dimension, allocatable, ..) remove P from the active declaration subtree keep parsetree consistent Parameter attribute: Much easier than parameter statement since attribute is detected before insertion of nodes into parsetree all variables declared are passive, so just restore original type
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 10 / 29
Parameter statement: real(kind=2), DIMENSION(2) :: X, P, Y PARAMETER( P = 3.14 ) When parser hits the parameter statement, P is already activated. So we have to find declaration node of P in parse tree detect original datatype of P create new declaration node with original data type copy all necessary attribute subtrees (dimension, allocatable, ..) remove P from the active declaration subtree keep parsetree consistent Parameter attribute: Much easier than parameter statement since attribute is detected before insertion of nodes into parsetree all variables declared are passive, so just restore original type
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 10 / 29
|-TYPE |-USERTYPE | |-NAME=COMPAD TYPE | \-COMMENT | |-REAL | | \-PAIR | | |-ID=KIND | | \-ICONST=2 | |-ICONST=2 | \-ICONST=2 |-DIMENSION | \-E BOUND | \-ICONST=2 |-NAME=X |-NAME=P \-NAME=Y |-TYPE |-USERTYPE | |-NAME=COMPAD TYPE | \-COMMENT | |-REAL | | \-PAIR | | |-ID=KIND | | \-ICONST=2 | |-ICONST=2 | \-ICONST=2 |-DIMENSION | \-E BOUND | \-ICONST=2 |-NAME=X \-NAME=Y |-TYPE |-REAL | \-PAIR | |-ID=KIND | \-ICONST=2 |-DIMENSION | \-E BOUND | \-ICONST=2 \-NAME=P
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 11 / 29
|-TYPE |-USERTYPE | |-NAME=COMPAD TYPE | \-COMMENT | |-REAL | | \-PAIR | | |-ID=KIND | | \-ICONST=2 | |-ICONST=2 | \-ICONST=2 |-DIMENSION | \-E BOUND | \-ICONST=2 |-NAME=X |-NAME=P \-NAME=Y |-TYPE |-USERTYPE | |-NAME=COMPAD TYPE | \-COMMENT | |-REAL | | \-PAIR | | |-ID=KIND | | \-ICONST=2 | |-ICONST=2 | \-ICONST=2 |-DIMENSION | \-E BOUND | \-ICONST=2 |-NAME=X \-NAME=Y |-TYPE |-REAL | \-PAIR | |-ID=KIND | \-ICONST=2 |-DIMENSION | \-E BOUND | \-ICONST=2 \-NAME=P
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 11 / 29
|-TYPE |-USERTYPE | |-NAME=COMPAD TYPE | \-COMMENT | |-REAL | | \-PAIR | | |-ID=KIND | | \-ICONST=2 | |-ICONST=2 | \-ICONST=2 |-DIMENSION | \-E BOUND | \-ICONST=2 |-NAME=X |-NAME=P \-NAME=Y |-TYPE |-USERTYPE | |-NAME=COMPAD TYPE | \-COMMENT | |-REAL | | \-PAIR | | |-ID=KIND | | \-ICONST=2 | |-ICONST=2 | \-ICONST=2 |-DIMENSION | \-E BOUND | \-ICONST=2 |-NAME=X \-NAME=Y |-TYPE |-REAL | \-PAIR | |-ID=KIND | \-ICONST=2 |-DIMENSION | \-E BOUND | \-ICONST=2 \-NAME=P
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 11 / 29
|-TYPE |-USERTYPE | |-NAME=COMPAD TYPE | \-COMMENT | |-REAL | | \-PAIR | | |-ID=KIND | | \-ICONST=2 | |-ICONST=2 | \-ICONST=2 |-DIMENSION | \-E BOUND | \-ICONST=2 |-NAME=X |-NAME=P \-NAME=Y |-TYPE |-USERTYPE | |-NAME=COMPAD TYPE | \-COMMENT | |-REAL | | \-PAIR | | |-ID=KIND | | \-ICONST=2 | |-ICONST=2 | \-ICONST=2 |-DIMENSION | \-E BOUND | \-ICONST=2 |-NAME=X \-NAME=Y |-TYPE |-REAL | \-PAIR | |-ID=KIND | \-ICONST=2 |-DIMENSION | \-E BOUND | \-ICONST=2 \-NAME=P
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 11 / 29
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 12 / 29
Input: modified parse tree from overloading mode (forward sweep) Modify forward sweep: Inclusion of module COMPAD SYSTEM providing a value stack and a control stack Replace references to COMPAD TYPE variables by their value component Transform to single assignment code (COMPAD TYPE temporaries) Place a value - push before every overwriting of a value component Place a control - push after of every logical decision Push array indices to control stack Create incremental reverse sweep from forward sweep Process assignments of forward sweep in reverse order Create Adjoint code for every assignment Place value - pops and control - pops where necessary Reset adjoint of left hand side
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 13 / 29
Input: modified parse tree from overloading mode (forward sweep) Modify forward sweep: Inclusion of module COMPAD SYSTEM providing a value stack and a control stack Replace references to COMPAD TYPE variables by their value component Transform to single assignment code (COMPAD TYPE temporaries) Place a value - push before every overwriting of a value component Place a control - push after of every logical decision Push array indices to control stack Create incremental reverse sweep from forward sweep Process assignments of forward sweep in reverse order Create Adjoint code for every assignment Place value - pops and control - pops where necessary Reset adjoint of left hand side
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 13 / 29
Input: modified parse tree from overloading mode (forward sweep) Modify forward sweep: Inclusion of module COMPAD SYSTEM providing a value stack and a control stack Replace references to COMPAD TYPE variables by their value component Transform to single assignment code (COMPAD TYPE temporaries) Place a value - push before every overwriting of a value component Place a control - push after of every logical decision Push array indices to control stack Create incremental reverse sweep from forward sweep Process assignments of forward sweep in reverse order Create Adjoint code for every assignment Place value - pops and control - pops where necessary Reset adjoint of left hand side
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 13 / 29
Note that Pure mode: operations are intrinsic operators and functions again Derived mode: overloaded operations or intrinsics for VALUE TYPE and DERIV TYPE
More information about adjoint code generation
Listen to Michael Maier in this session
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 14 / 29
Note that Pure mode: operations are intrinsic operators and functions again Derived mode: overloaded operations or intrinsics for VALUE TYPE and DERIV TYPE
More information about adjoint code generation
Listen to Michael Maier in this session
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 14 / 29
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 15 / 29
Task: minx∈Rn f (x) where f : Rn → R f twice continously differentiable f has bounded level sets {x : f (x) ≤ f (x0)} ∀x0 ∈ Rn Some properties of the Truncated Newton approach avoid saddlepoints (detection of directions with negative curvature) requires Hessian vector products only, not the full Hessian automatic exploitation of symmetries in f in theory for exact convergence:
# inner iterations = # distinct eigenvalues of f which is often much smaller than dimension of x
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 16 / 29
Task: minx∈Rn f (x) where f : Rn → R f twice continously differentiable f has bounded level sets {x : f (x) ≤ f (x0)} ∀x0 ∈ Rn Some properties of the Truncated Newton approach avoid saddlepoints (detection of directions with negative curvature) requires Hessian vector products only, not the full Hessian automatic exploitation of symmetries in f in theory for exact convergence:
# inner iterations = # distinct eigenvalues of f which is often much smaller than dimension of x
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 16 / 29
Major iteration Input:: start point x0 ∈ Rn Test for convergence, Stop if convergence Minor iteration to find new direction pk
p(0)
k
= −g(xk) requires gradient at old xk Solve H(xk)p(i)
k
= −g(xk) until convergence
Generates a sequence p(i)
k
Repeated Hessian - vector products required at fixed xk
Calculate step length λk requires gradient ∇f (xk + λkpk) xk+1 = xk + λkpk
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 17 / 29
Hybrid means here Source code transformation to get the adjoint code Thus we get x and ¯ x But adjoint code deals with variables of derived type TLS TYPE COMPAD TYPE provides overloaded operators for TLS TYPE This gives a forward mode differentiation to get ˙ x and ˙ ¯ x In fact we get a mix of source transformation and Overloading How does the COMPAD TYPE looks like? type compad type type(tls type) :: val ! value x type(tls type) :: drv ! adjoint ¯ x end type compad type type tls type double precision :: val=0 ! tangent ˙ x double precision :: drv=0 ! second order ˙ ¯ x end type tls type
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 18 / 29
Hybrid means here Source code transformation to get the adjoint code Thus we get x and ¯ x But adjoint code deals with variables of derived type TLS TYPE COMPAD TYPE provides overloaded operators for TLS TYPE This gives a forward mode differentiation to get ˙ x and ˙ ¯ x In fact we get a mix of source transformation and Overloading How does the COMPAD TYPE looks like? type compad type type(tls type) :: val ! value x type(tls type) :: drv ! adjoint ¯ x end type compad type type tls type double precision :: val=0 ! tangent ˙ x double precision :: drv=0 ! second order ˙ ¯ x end type tls type
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 18 / 29
C ********************************************************** C * HATFIELD POLYTECHNIC * C * NUMERICAL OPTIMISATION CENTRE * C * THE OPTIMA PACKAGE * C * DOUBLE PRECISION SUBROUTINE: OPTNHP.FOR * C * VERSION 1, JANUARY 1989 * C ********************************************************** C C C PURPOSE: To find a local minimum of a function of several C variables using truncated newton method. C C AUTHOR: Z.A. MAANY, NUMERICAL OPTIMISATION CENTRE C C USAGE:CALL OPTNHP (N,X,FF,G,MAXIT,EPS,IPRINT,W,NW)
Subroutine OPTNHB assume existence of 3 evaluation routines SUBROUTINE CALFUN(X,N,FF,INF) function SUBROUTINE CALGRD(X,N,FF,G,INF) gradient SUBROUTINE CALHP(X,G,N,P,HP,INF) Hessian-vector
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 19 / 29
C ********************************************************** C * HATFIELD POLYTECHNIC * C * NUMERICAL OPTIMISATION CENTRE * C * THE OPTIMA PACKAGE * C * DOUBLE PRECISION SUBROUTINE: OPTNHP.FOR * C * VERSION 1, JANUARY 1989 * C ********************************************************** C C C PURPOSE: To find a local minimum of a function of several C variables using truncated newton method. C C AUTHOR: Z.A. MAANY, NUMERICAL OPTIMISATION CENTRE C C USAGE:CALL OPTNHP (N,X,FF,G,MAXIT,EPS,IPRINT,W,NW)
Subroutine OPTNHB assume existence of 3 evaluation routines SUBROUTINE CALFUN(X,N,FF,INF) function SUBROUTINE CALGRD(X,N,FF,G,INF) gradient SUBROUTINE CALHP(X,G,N,P,HP,INF) Hessian-vector
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 19 / 29
Rosenbrock problem: f (x, y) = (1 − x)2 + 100(y − x2)2
2 4 6 8 10 12 0.2 0.4 0.6 0.8 1 1.2 1.4
0.5 1 1.5 2 2.5 3 2 4 6 8 10 12 ((1-x)**2 + 100*(y-x*x)**2)/100 Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 20 / 29
main x 3.0000000000000000 4.0000000000000000 SUBROUTINE OPTNHP STARTED ************************* ’CONJUGATE GRADIENT TRUNCATED NEWTON’ CONVERGE IF EUCLIDEAN NORM OF GRAD F < 1.0000000D-08 . . . Second order adjoints NEW POINT 1.0000000D-00 1.0000000D-00 FUNCTION = 1.7998949D-18 GRADIENT
29 FUNCTION CALLS 31 MINOR ITERATIONS 20 MAJOR ITERATIONS CONVERGENCE Divided Differences (ǫ = 10−7) NEW POINT 1.0000089D+00 1.0000178D+00 FUNCTION = 7.9281058D-11 GRADIENT 2.1743654D-05 2.8036572D-05 33884 FUNCTION CALLS 8757 MINOR ITERATIONS 6017 MAJOR ITERATIONS NO FURTHER FUNCTION DECREASE OBTAINED
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 21 / 29
main x 3.0000000000000000 4.0000000000000000 SUBROUTINE OPTNHP STARTED ************************* ’CONJUGATE GRADIENT TRUNCATED NEWTON’ CONVERGE IF EUCLIDEAN NORM OF GRAD F < 1.0000000D-08 . . . Second order adjoints NEW POINT 1.0000000D-00 1.0000000D-00 FUNCTION = 1.7998949D-18 GRADIENT
29 FUNCTION CALLS 31 MINOR ITERATIONS 20 MAJOR ITERATIONS CONVERGENCE Divided Differences (ǫ = 10−7) NEW POINT 1.0000089D+00 1.0000178D+00 FUNCTION = 7.9281058D-11 GRADIENT 2.1743654D-05 2.8036572D-05 33884 FUNCTION CALLS 8757 MINOR ITERATIONS 6017 MAJOR ITERATIONS NO FURTHER FUNCTION DECREASE OBTAINED
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 21 / 29
main x 3.0000000000000000 4.0000000000000000 SUBROUTINE OPTNHP STARTED ************************* ’CONJUGATE GRADIENT TRUNCATED NEWTON’ CONVERGE IF EUCLIDEAN NORM OF GRAD F < 1.0000000D-08 . . . Second order adjoints NEW POINT 1.0000000D-00 1.0000000D-00 FUNCTION = 1.7998949D-18 GRADIENT
29 FUNCTION CALLS 31 MINOR ITERATIONS 20 MAJOR ITERATIONS CONVERGENCE Divided Differences (ǫ = 10−7) NEW POINT 1.0000089D+00 1.0000178D+00 FUNCTION = 7.9281058D-11 GRADIENT 2.1743654D-05 2.8036572D-05 33884 FUNCTION CALLS 8757 MINOR ITERATIONS 6017 MAJOR ITERATIONS NO FURTHER FUNCTION DECREASE OBTAINED
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 21 / 29
PROGRAM tn ros ovl IMPLICIT NONE INTEGER, PARAMETER :: N = 2 DOUBLE PRECISION :: X(N),G(N), FF INTEGER, PARAMETER :: NW = 160 DOUBLE PRECISION :: W(NW), EPS INTEGER :: IOC, IPRINT, IMAX COMMON/DEVICE/IOC IOC=6 WRITE(IOC,101) READ(5,111)IPRINT,IMAX,EPS X(1) = 3 ; X(2) = 4 print *,’main x ’, x CALL OPTNHP(N,X,FF,G,IMAX,EPS,IPRINT,W,NW) STOP
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 22 / 29
SUBROUTINE rosenbrock ( a, res) implicit none DOUBLE PRECISION :: a(2) , res INTEGER :: i = 1 ! Rosenbrock Function. ! f(x,y) = (1-x)**2 + 100(y-x**2)**2 DOUBLE PRECISION :: t1, t2, t3 t1 = 1 - a(i) t2 = t1*t1 t3 = a(2) - a(i)*a(i) res = t2 + 100 * t3*t3 END SUBROUTINE
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 23 / 29
Since compiler does not create new names for differentiated routines at the moment . . .
#ifdef AD ADJOINT SUBROUTINE rosenbrock adj (a, res) USE COMPAD SYSTEM #elif AD OVL SUBROUTINE rosenbrock ovl (a, res) #else SUBROUTINE rosenbrock ( a, res) #endif
But he will in the future ...
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 24 / 29
SUBROUTINE CALFUN(X,N,FF,INF) IMPLICIT NONE INTEGER :: N, INF DOUBLE PRECISION :: X(N), FF ! INF != 0 signals infeasibility INF=0 call rosenbrock(x,FF) RETURN END
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 25 / 29
SUBROUTINE CALHP(X,G,N,P,HP,INF) use compad module use compad system IMPLICIT NONE INTEGER :: N, INF, I DOUBLE PRECISION :: X(N),G(N),P(N),HP(N) TYPE(COMPAD TYPE) :: CTX(2), CTF INF=0 DO i=1,2 ctx(i)%val%val = X(i) ! xi value ctx(i)%val%drv = P(i) ! ˙ xi ctx(i)%drv%val = 0.D0 ! ¯ xi ctx(i)%drv%drv = 0.D0 ! ˙ ¯ xi ENDDO ctf%val%val = 0.D0 ! f value ctf%val%drv = 0.D0 ! ˙ f ctf%drv%val = 1.D0 ! ¯ f ctf%drv%drv = 0.D0 ! ˙ ¯ f call rosenbrock adj(ctx,ctf) HP(1) = ctx(1)%drv%drv HP(2) = ctx(2)%drv%drv
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 26 / 29
SUBROUTINE CALHP(X,G,N,P,HP,INF) use compad module use compad system IMPLICIT NONE INTEGER :: N, INF, I DOUBLE PRECISION :: X(N),G(N),P(N),HP(N) TYPE(COMPAD TYPE) :: CTX(2), CTF INF=0 DO i=1,2 ctx(i)%val%val = X(i) ! xi value ctx(i)%val%drv = P(i) ! ˙ xi ctx(i)%drv%val = 0.D0 ! ¯ xi ctx(i)%drv%drv = 0.D0 ! ˙ ¯ xi ENDDO ctf%val%val = 0.D0 ! f value ctf%val%drv = 0.D0 ! ˙ f ctf%drv%val = 1.D0 ! ¯ f ctf%drv%drv = 0.D0 ! ˙ ¯ f call rosenbrock adj(ctx,ctf) HP(1) = ctx(1)%drv%drv HP(2) = ctx(2)%drv%drv
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 26 / 29
SUBROUTINE CALHP(X,G,N,P,HP,INF) use compad module use compad system IMPLICIT NONE INTEGER :: N, INF, I DOUBLE PRECISION :: X(N),G(N),P(N),HP(N) TYPE(COMPAD TYPE) :: CTX(2), CTF INF=0 DO i=1,2 ctx(i)%val%val = X(i) ! xi value ctx(i)%val%drv = P(i) ! ˙ xi ctx(i)%drv%val = 0.D0 ! ¯ xi ctx(i)%drv%drv = 0.D0 ! ˙ ¯ xi ENDDO ctf%val%val = 0.D0 ! f value ctf%val%drv = 0.D0 ! ˙ f ctf%drv%val = 1.D0 ! ¯ f ctf%drv%drv = 0.D0 ! ˙ ¯ f call rosenbrock adj(ctx,ctf) HP(1) = ctx(1)%drv%drv HP(2) = ctx(2)%drv%drv
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 26 / 29
SUBROUTINE CALHP(X,G,N,P,HP,INF) use compad module use compad system IMPLICIT NONE INTEGER :: N, INF, I DOUBLE PRECISION :: X(N),G(N),P(N),HP(N) TYPE(COMPAD TYPE) :: CTX(2), CTF INF=0 DO i=1,2 ctx(i)%val%val = X(i) ! xi value ctx(i)%val%drv = P(i) ! ˙ xi ctx(i)%drv%val = 0.D0 ! ¯ xi ctx(i)%drv%drv = 0.D0 ! ˙ ¯ xi ENDDO ctf%val%val = 0.D0 ! f value ctf%val%drv = 0.D0 ! ˙ f ctf%drv%val = 1.D0 ! ¯ f ctf%drv%drv = 0.D0 ! ˙ ¯ f call rosenbrock adj(ctx,ctf) HP(1) = ctx(1)%drv%drv HP(2) = ctx(2)%drv%drv
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 26 / 29
Identical with CALHP() beside different initialisation
DO i=1,2 ctx(i)%val%val = X(i) ! xi value ctx(i)%val%drv = 0.D0 ! ˙ xi ctx(i)%drv%val = 0.D0 ! ¯ xi ctx(i)%drv%drv = 0.D0 ! ˙ ¯ xi ENDDO ctf%val%val = 0.D0 ! f value ctf%val%drv = 0.D0 ! ˙ f ctf%drv%val = 1.D0 ! ¯ f ctf%drv%drv = 0.D0 ! ˙ ¯ f call rosenbrock adj(ctx,ctf) G(1) = ctx(1)%drv%val G(2) = ctx(2)%drv%val
Note that second order adjoints are computed here too. To avoid that a second variant of COMPAD TYPE would be required (major effort).
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 27 / 29
Identical with CALHP() beside different initialisation
DO i=1,2 ctx(i)%val%val = X(i) ! xi value ctx(i)%val%drv = 0.D0 ! ˙ xi ctx(i)%drv%val = 0.D0 ! ¯ xi ctx(i)%drv%drv = 0.D0 ! ˙ ¯ xi ENDDO ctf%val%val = 0.D0 ! f value ctf%val%drv = 0.D0 ! ˙ f ctf%drv%val = 1.D0 ! ¯ f ctf%drv%drv = 0.D0 ! ˙ ¯ f call rosenbrock adj(ctx,ctf) G(1) = ctx(1)%drv%val G(2) = ctx(2)%drv%val
Note that second order adjoints are computed here too. To avoid that a second variant of COMPAD TYPE would be required (major effort).
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 27 / 29
Identical with CALHP() beside different initialisation
DO i=1,2 ctx(i)%val%val = X(i) ! xi value ctx(i)%val%drv = 0.D0 ! ˙ xi ctx(i)%drv%val = 0.D0 ! ¯ xi ctx(i)%drv%drv = 0.D0 ! ˙ ¯ xi ENDDO ctf%val%val = 0.D0 ! f value ctf%val%drv = 0.D0 ! ˙ f ctf%drv%val = 1.D0 ! ¯ f ctf%drv%drv = 0.D0 ! ˙ ¯ f call rosenbrock adj(ctx,ctf) G(1) = ctx(1)%drv%val G(2) = ctx(2)%drv%val
Note that second order adjoints are computed here too. To avoid that a second variant of COMPAD TYPE would be required (major effort).
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 27 / 29
Main targets: Robust adjoint compiler Adjoints of MINPACK-II problems Adjoints of CNS – code Checkpointing of loops Secondary targets: Coupling of adjoint compiler with ADAC Coupling of adjoint compiler with ADOLC
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 28 / 29
Main targets: Robust adjoint compiler Adjoints of MINPACK-II problems Adjoints of CNS – code Checkpointing of loops Secondary targets: Coupling of adjoint compiler with ADAC Coupling of adjoint compiler with ADOLC
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 28 / 29
Uwe Naumann, Michael Maier RWTH Aachen, Germany[1ex] Bruce Christianson, Dmitrij Gendler, Jan Riehme University of Hertfordshire, Second Order Adjoints with the NAG Fortran 95 Compiler May 22, 2007 29 / 29