[petsc-users] SNES: approximating the Jacobian with computed residuals?

Fischer, Greg A. fischega at westinghouse.com
Tue Apr 22 10:56:55 CDT 2014


From: Peter Brune [mailto:prbrune at gmail.com]
Sent: Tuesday, April 22, 2014 10:16 AM
To: Fischer, Greg A.
Cc: petsc-users at mcs.anl.gov
Subject: Re: [petsc-users] SNES: approximating the Jacobian with computed residuals?

On Tue, Apr 22, 2014 at 8:48 AM, Fischer, Greg A. <fischega at westinghouse.com<mailto:fischega at westinghouse.com>> wrote:
Hello PETSc-users,

I'm using the SNES component with the NGMRES method in my application. I'm using a matrix-free context for the Jacobian and the MatMFFDComputeJacobian() function in my FormJacobian routine. My understanding is that this effectively approximates the Jacobian using the equation at the bottom of Page 103 in the PETSc User's Manual. This works, but the expense of computing two function evaluations in each SNES iteration nearly wipes out the performance improvements over Picard iteration.

Try -snes_type anderson.  It's less stable than NGMRES, but requires one function evaluation per iteration.  The manual is out of date.  I guess it's time to fix that.  It's interesting that the cost of matrix assembly and a linear solve is around the same as that of a function evaluation.  Output from -log_summary would help in the diagnosis.

I tried the –snes_type anderson option, and it seems to be requiring even more function evaluations than the Picard iterations. I’ve attached –log_summary output. This seems strange, because I can use the NLKAIN code (http://nlkain.sourceforge.net/) to fairly good effect, and I’ve read that it’s related to Anderson mixing. Would it be useful to adjust the parameters?

I’ve also attached –log_summary output for NGMRES. Does anything jump out as being amiss?



Based on my (limited) understanding of the Oosterlee/Washio SIAM paper ("Krylov Subspace Acceleration of Nonlinear Multigrid..."), they seem to suggest that it's possible to approximate the Jacobian with a series of previously-computed residuals (eq 2.14), rather than additional function evaluations in each iteration. Is this correct? If so, could someone point me to a reference that demonstrates how to do this with PETSc?

What indication do you have that the Jacobian is calculated at all in the NGMRES method?  The two function evaluations are related to computing the quantities labeled F(u_M) and F(u_A) in O/W.  We already use the Jacobian approximation for the minimization problem (2.14).

- Peter

Thanks for the clarification.

-Greg


Or, perhaps a better question to ask is: are there other ways of reducing the computing burden associated with estimating the Jacobian?

Thanks,
Greg

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140422/97be0fd7/attachment-0001.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: anderson_log_summary.txt
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140422/97be0fd7/attachment-0002.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ngmres_log_summary.txt
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140422/97be0fd7/attachment-0003.txt>


More information about the petsc-users mailing list