skip to main content
research-article

OpenAD/F: A Modular Open-Source Tool for Automatic Differentiation of Fortran Codes

Published: 01 July 2008 Publication History

Abstract

The Open/ADF tool allows the evaluation of derivatives of functions defined by a Fortran program. The derivative evaluation is performed by a Fortran code resulting from the analysis and transformation of the original program that defines the function of interest. Open/ADF has been designed with a particular emphasis on modularity, flexibility, and the use of open source components. While the code transformation follows the basic principles of automatic differentiation, the tool implements new algorithmic approaches at various levels, for example, for basic block preaccumulation and call graph reversal. Unlike most other automatic differentiation tools, Open/ADF uses components provided by the Open/AD framework, which supports a comparatively easy extension of the code transformations in a language-independent fashion. It uses code analysis results implemented in the OpenAnalysis component. The interface to the language-independent transformation engine is an XML-based format, specified through an XML schema. The implemented transformation algorithms allow efficient derivative computations using locally optimized cross-country sequences of vertex, edge, and face elimination steps. Specifically, for the generation of adjoint codes, Open/ADF supports various code reversal schemes with hierarchical checkpointing at the subroutine level. As an example from geophysical fluid dynamics, a nonlinear time-dependent scalable, yet simple, barotropic ocean model is considered. OpenAD/F's reverse mode is applied to compute sensitivities of some of the model's transport properties with respect to gridded fields such as bottom topography as independent (control) variables.

References

[1]
ACTS. 2007. Adjoint compiler technology and standards project. http://www.autodiff.org/ACTS.
[2]
ADIC. 2007. http://www.mcs.anl.gov/adicserver.
[3]
Aho, A., Sethi, R., and Ullman, J. 1986. Compilers. Principles, Techniques, and Tools. Addison-Wesley, Reading, MA.
[4]
Albrecht, A., Gottschling, P., and Naumann, U. 2003. Markowitz-type heuristics for computing Jacobian matrices efficiently. In Computational Science (ICCS'03). Lecture Notes in Computer Science, vol. 2658. Springer, 575--584.
[5]
Berz, M., Bischof, C., Corliss, G., and Griewank, A., Eds. 1996. Computational Differentiation: Techniques, Applications, and Tools. Proceedings Series. SIAM, Philadelphia, PA.
[6]
Bücker, M., Corliss, G., Hovland, P., Naumann, U., and Norris, B., Eds. 2006. Automatic Differentiation: Applications, Theory and Implementations. Lecture Notes in Computer Science, vol. 50. Springer, Berlin, Germany.
[7]
Corliss, G., Faure, C., Griewank, A., Hascoet, L., and Naumann, U., Eds. 2002. Automatic Differentiation of Algorithms -- From Simulation to Optimization. Springer, Berlin, Germany.
[8]
Corliss, G. and Griewank, A., Eds. 1991. In Proceedings of Automatic Differentiation: Theory, Implementation, and Application. SIAM, Philadelphia, PA.
[9]
Faure, C. and Papegay, Y. 1997. Odyssée version 1.6: The user's reference manual. Tech. rep. Sophia Antipolis, Projet SAFIR. http://www.inria.fr/recherche/equipes/safir.en.html.
[10]
Giering, R. and Kaminski, T. 1998. Recipes for adjoint code construction. ACM Trans. Math. Softw. 24, 437--474.
[11]
Griewank, A. 2000. Evaluating Derivatives. Principles and Techniques of Algorithmic Differentiation. Frontiers in Applied Mathematics, vol. 19, SIAM, Philadelphia, PA.
[12]
Griewank, A. and Reese, S. 1991. On the calculation of Jacobian matrices by the Markovitz rule. In Proceedings of Automatic Differentiation: Theory, Implementation, and Application. SIAM, 126--135.
[13]
Hascoët, L., Naumann, U., and Pascual, V. 2005. To be recorded analysis in reverse-mode automatic differentiation. Future Gener. Comput. Syst. 21, 8, 1401--1417.
[14]
Heimbach, P., Hill, C., and Giering, R. 2005. An efficient exact adjoint of the parallel MIT general circulation model, generated via automatic differentiation. Future Gener. Comput. Syst. 21, 8, 1356--1371.
[15]
Hovland, P., Naumann, U., and Norris, B. 2002. An XML-based platform for semantic transformation of numerical programs. In Software Engineering and Applications (SEA'02), M. Hamza, Ed. ACTA Press, Anaheim,CA, 530--538.
[16]
Losch, M. and Wunsch, C. 2003. Bottom topography as a control variable in an ocean model. J. Atmosph. Ocean. Techn. 20, 1685--1696.
[17]
Marotzke, J., Giering, R., Zhang, K., Stammer, D., Hill, C., and Lee, T. 1999. Construction of the adjoint MIT ocean general circulation model and application to Atlantic heat transport variability. J. Geophys. Resear. 104, C12, 29, 529--29, 547.
[18]
Marshall, J., Adcroft, A., Hill, C., Perelman, L., and Heisey, C. 1997. A finite-volume, incompressible Navier Stokes model for studies of the ocean on parallel computers. J. Geophys. Resear. 102, C3, 5,753--5,766.
[19]
Naumann, U. 2002. Elimination techniques for cheap Jacobians. In Automatic Differentiation of Algorithms - From Simulation to Optomization. Springer, 247--253.
[20]
Naumann, U. 2004. Optimal accumulation of Jacobian matrices by elimination methods on the dual computational graph. Math. Prog. 3, 99, 399--421.
[21]
Naumann, U. 2006. Optimal Jacobian accumulation is NP-complete. Math. Prog. published online at www.springerlink.com.
[22]
Naumann, U. and Gottschling, P. 2003. Simulated annealing for optimal pivot selection in Jacobian accumulation. In Stochastic Algorithms: Foundations and Applications, A. Albrecht and K. Steinhöfel, Eds. Lecture Notes in Computer Science, vol. 2827. Springer, 83--97.
[23]
Naumann, U. and Utke, J. 2005. Source templates for the automatic generation of adjoint code through static call graph reversal. In Computational Science - ICCS'05, V. Sunderam, G. van Albada, P. Sloot, and J. Dongarra, Eds. Lecture Notes in Computer Science, vol. 3514. Springer, 338--346.
[24]
Naumann, U., Utke, J., Lyons, A., and Fagan, M. 2004. Control flow reversal for adjoint code generation. In Proceedings of the 4th IEEE International Workshop on Source Code Analysis and Manipulation (SCAM'04). IEEE Computer Society, Los Alamitos, CA, 55--64.
[25]
NEOS. 2007. Network enhanced optimization server. http://www-neos.mcs.anl.gov/.
[26]
OpenAD. 2007. http://www.mcs.anl.gov/OpenAD.
[27]
OpenMP. 2007. http://www.openmp.org.
[28]
Stammer, D., Wunsch, C., Giering, R., Eckert, C., Heimbach, P., Marotzke, J., Adcroft, A., Hill, C., and Marshall, J. 2002. The global ocean circulation and transports during 1992 -- 1997, estimated from ocean observations and a general circulation model. J. Geophys. Resear. 107, C9, 3118.
[29]
Strout, M. and Hovland, P. 2006. Linearity analysis for automatic differentiation. In Computational Science -- ICCS'06. Lecture Notes in Computer Science, vol. 3994. Springer, 574--581.
[30]
Strout, M., Mellor-Crummey, J., and Hovland, P. 2005. Representation-independent program analysis. In Proceedings of the 6th ACM SIGPLAN-SIGSOFT Workshop on Program Analysis for Software Tools and Engineering (PASTE).
[31]
Utke, J. 2006. Flattening basic blocks. Lecture Notes in Computer Science, vol. 5C, Springer, 121--133.
[32]
Utke, J., Lyons, A., and Naumann, U. 2006. Efficient reversal of the interprocedural flow of control in adjoint computations. J. Syst. Softw. 79, 1280--1294.
[33]
Utke, J. and Naumann, U. 2003. Software technological issues in automatizing the semantic transformation of numerical programs. In Proceedings of Software Engineering and Applications (SEA'03), M. Hamza, Ed. ACTA Press, Anaheim, CA, 417--422.
[34]
Utke, J. and Naumann, U. 2004. Separating language dependent and independent tasks for the semantic transformation of numerical programs. In Proceedings of Software Engineering and Applications (SEA'04), M. Hamza, Ed. ACTA Press, Anaheim, CA, 552--558.
[35]
Utke, J. and Naumann, U. 2006. OpenAD/F: User manual. Tech. rep. Argonne National Laboratory. http://www.mcs.anl.gov/openad/.
[36]
Wengert, R. E. 1964. A simple automatic derivative evaluation program. Comm. ACM 7, 8, 463--464.
[37]
Wunsch, C. 2006. Discrete Inverse and State Estimation Problems: With Geophysical Fluid Applications. Cambridge University Press, Cambridge, UK.
[38]
Wunsch, C. and Heimbach, P. 2007. Practical global oceanic state estimation. Physica D. To appear. 230, 197--208.

Cited By

View all
  • (2025)MITgcm-AD v2: Open source tangent linear and adjoint modeling framework for the oceans and atmosphere enabled by the Automatic Differentiation tool TapenadeFuture Generation Computer Systems10.1016/j.future.2024.107512163(107512)Online publication date: Feb-2025
  • (2024)Scrutinizing Variables for Checkpoint Using Automatic DifferentiationSC24-W: Workshops of the International Conference for High Performance Computing, Networking, Storage and Analysis10.1109/SCW63240.2024.00056(372-379)Online publication date: 17-Nov-2024
  • (2024)TapeFlow: Streaming Gradient Tapes in Automatic DifferentiationProceedings of the 2024 IEEE/ACM International Symposium on Code Generation and Optimization10.1109/CGO57630.2024.10444805(81-92)Online publication date: 2-Mar-2024
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Transactions on Mathematical Software
ACM Transactions on Mathematical Software  Volume 34, Issue 4
July 2008
152 pages
ISSN:0098-3500
EISSN:1557-7295
DOI:10.1145/1377596
Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 July 2008
Accepted: 01 July 2007
Revised: 01 May 2007
Received: 01 November 2000
Published in TOMS Volume 34, Issue 4

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Automatic differentiation
  2. adjoint compiler
  3. source transformation

Qualifiers

  • Research-article
  • Research
  • Refereed

Funding Sources

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)29
  • Downloads (Last 6 weeks)5
Reflects downloads up to 12 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2025)MITgcm-AD v2: Open source tangent linear and adjoint modeling framework for the oceans and atmosphere enabled by the Automatic Differentiation tool TapenadeFuture Generation Computer Systems10.1016/j.future.2024.107512163(107512)Online publication date: Feb-2025
  • (2024)Scrutinizing Variables for Checkpoint Using Automatic DifferentiationSC24-W: Workshops of the International Conference for High Performance Computing, Networking, Storage and Analysis10.1109/SCW63240.2024.00056(372-379)Online publication date: 17-Nov-2024
  • (2024)TapeFlow: Streaming Gradient Tapes in Automatic DifferentiationProceedings of the 2024 IEEE/ACM International Symposium on Code Generation and Optimization10.1109/CGO57630.2024.10444805(81-92)Online publication date: 2-Mar-2024
  • (2024)Characterizing Subglacial Hydrology Within the Amery Ice Shelf Catchment Using Numerical Modeling and Satellite AltimetryJournal of Geophysical Research: Earth Surface10.1029/2023JF007421129:4Online publication date: 20-Apr-2024
  • (2024)Fundamental Properties of Adjoint Model and Adjoint Sensitivity Under Fully Nonlinear Hydrostatic Internal Gravity WavesJournal of Geophysical Research: Oceans10.1029/2023JC020577129:8Online publication date: 9-Aug-2024
  • (2023)SLANG.D: Fast, Modular and Differentiable Shader ProgrammingACM Transactions on Graphics10.1145/361835342:6(1-28)Online publication date: 5-Dec-2023
  • (2023)Constraints on subglacial melt fluxes from observations of active subglacial lake rechargeJournal of Glaciology10.1017/jog.2023.70(1-15)Online publication date: 26-Sep-2023
  • (2023)Toward the end-to-end optimization of particle physics instruments with differentiable programmingReviews in Physics10.1016/j.revip.2023.10008510(100085)Online publication date: Jun-2023
  • (2023)Towards a fully unstructured ocean model for ice shelf cavity environments: Model development and verification using the Firedrake finite element frameworkOcean Modelling10.1016/j.ocemod.2023.102178182(102178)Online publication date: Apr-2023
  • (2022)Towards Efficient Cache Allocation for High-Frequency Checkpointing2022 IEEE 29th International Conference on High Performance Computing, Data, and Analytics (HiPC)10.1109/HiPC56025.2022.00043(262-271)Online publication date: Dec-2022
  • Show More Cited By

View Options

Login options

Full Access

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media