[petsc-dev] AD support in PETSc?

Matthew Knepley knepley at gmail.com
Sun Sep 10 08:40:19 CDT 2017


In my opinion, the software engineering problem with ADIFOR(C) is that they
are designed to run on whole programs. What
we really want is for small pieces of code, like routines for element
vectors, to be differentiated. Once you get whole programs,
you need to parse system headers, etc. which is a Herculean task. It broke
so often that they would maintain a machine in MCS
to run on and then spit out the differentiated code. It became too much to
maintain and we got rid of it. I like the FEniCS/Firedrake
approach much better, in that you differentiate the intermediate
representation, and then generate code.

   Matt


On Sun, Sep 10, 2017 at 9:32 AM, Patrick Sanan <patrick.sanan at gmail.com>
wrote:

> I asked Barry about this wrt the manual a while ago, and we removed all
> reference to ADIFOR there, since it was no longer supported.
> Stefano Zampini <stefano.zampini at gmail.com> schrieb am So. 10. Sep. 2017
> um 13:15:
>
>> Should the references to ADIFOR listed below be removed? It seems PETSc
>> does no longer provide support for automatic differentiation. I never used
>> AD support in PETSc, but I was considering adding some reverse mode support
>> to compute the transpose of the Jacobian matrices in adjoint computations.
>> May ask why was it removed?
>>
>>
>> [szampini at localhost petsc]$ git grep -i adifor
>> bin/adiforfix.py:# $Id: adiforfix.py,v 1.3 2001/08/24 16:32:18 bsmith Exp
>> $
>> bin/adiforfix.py:#      | adiforfix.py
>> include/petsc/private/matimpl.h:  PetscErrorCode (*setvaluesadifor)(Mat,
>> PetscInt,void*);
>> include/petscmat.h:               MATOP_SET_VALUES_ADIFOR=74,
>> lib/petsc/conf/test:testexamples_ADIFOR: ${TESTEXAMPLES_ADIFOR}
>> lib/petsc/conf/test:    -@ if test ${PRINT_PROGRESS}foo = debugtestfoo -a
>> -n "${TESTEXAMPLES_ADIFOR}"; then printf "Running examples in `pwd`:\n
>> ${TESTEXAMPLES_ADIFOR}\n"; fi
>> lib/petsc/conf/test:buildexamples_ADIFOR:
>> lib/petsc/conf/test:    -@${OMAKE} testexamples_ADIFOR
>> TESTEXAMPLES_ADIFOR=`echo ${TESTEXAMPLES_ADIFOR} | sed
>> s/runex[0-9]*[a-z0-9_]*//g`
>> src/docs/tao_tex/manual/mathprog.bib:@TechReport{bischof.carle.ea:adifor,
>> src/docs/tao_tex/manual/mathprog.bib:  title =        "{ADIFOR} 2.0
>> User's Guide",
>> src/docs/tex/petscapp.bib:  title = "Using {ADIFOR} and {ADIC} to Provide
>> a {J}acobian for the {SNES} Component of {PETSc}",
>> src/mat/f90-mod/petscmat.h:      PetscEnum MATOP_SET_VALUES_ADIFOR
>> src/mat/f90-mod/petscmat.h:      parameter(MATOP_SET_VALUES_ADIFOR=74)
>> src/snes/examples/tutorials/makefile:   -@${MPIEXEC} -n 2 ./ex5f
>> -adifor_jacobian -snes_monitor_short -ksp_gmres_cgs_refinement_type
>> refine_always > ex5f_4.tmp 2>&1;\
>> src/snes/examples/tutorials/makefile:   -@${MPIEXEC} -n 2 ./ex5f
>> -adiformf_jacobian  -snes_monitor_short -ksp_gmres_cgs_refinement_type
>> refine_always > ex5f_5.tmp 2>&1;\
>> src/snes/examples/tutorials/makefile:TESTEXAMPLES_ADIFOR               =
>> ex5f.PETSc runex5f_2 ex5f.rm
>>
>>
>> --
>> Stefano
>>
>


-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

http://www.caam.rice.edu/~mk51/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20170910/4e369705/attachment.html>


More information about the petsc-dev mailing list