Section: New Results

AD of mixed-language codes

Participants : Valérie Pascual, Laurent Hascoët.

Last year Tapenade was extended to differentiate codes that mix different languages, beginning with the tangent mode of AD. Our motivating application here is Calculix, a 3-D Structural Finite Element code that mixes Fortran and C. This year, we continued development towards Adjoint Differentiation. Although more complete testing is needed, we now have a first correct adjoint of Calculix.

Tapenade can now routinely differentiate Fortran+C codes, and accepts and takes advantage of the interoperability directives provided by the Fortran 2003 standard. It can handle not only procedure parameters correspondence, but also interoperability between C struct and Fortran COMMON blocks. Laurent Hascoët presented the advancement of this work at the ISMP 2018 congress in Bordeaux https://ismp2018.sciencesconf.org/.

C files (aka “translation units”) and Fortran modules are two instances of the more general notion of “package” for which we are looking for a unified representation in Tapenade. It appears that this common representation could also handle C++ namespaces.