Copying discussion from libmesh-users, both because it looks like a library- rather than a user-level problem and because I'm hoping one of our PETSc expert lurkers will chime in.
Summary: running a libMesh adjoint_solve() on a particular coupled multiphysics system on a small mesh claims to solve the adjoint system down past 1e-10 tolerance, but manually evaluating the residual magnitude afterwards shows more like 1e-4. Turning off preconditioning eliminates the discrepancy. ---------- Forwarded message ---------- Date: Wed, 7 Jan 2015 17:06:16 -0600 (CST) From: Roy Stogner <royst...@ices.utexas.edu> To: libmesh-us...@lists.sourceforge.net Subject: Re: [Libmesh-users] Adjoint Solve On Wed, 7 Jan 2015, Roy Stogner wrote: > Was using PETSc without any good solver packages built in, but > "-mat_view ::ascii_matlab" and octave were enough to catch the red > herring; the matrix is fine. The matrix is fine, but the preconditioners aren't. If I run with "-pc_type jacobi" (how does this not NaN with your matrix with zeros on the diagonal?) or just plain "-pc_type none", then everything's fine: ~ *~*~*~*~*~*~*~*~ adjoint solve start ~*~*~*~*~*~*~*~*~ number of iterations to solve adjoint: 87 final residual of adjoint solve: 8.65357e-14 ~ *~*~*~*~*~*~*~*~ adjoint solve end ~*~*~*~*~*~*~*~*~ ------------ herp derp ------------ adjoint system residual (discrete L2): 8.65326e-14 adjoint system residual (L2, all): 2.62094e-14 adjoint system residual (L2, 0): 2.06412e-14 adjoint system residual (L2, 1): 1.61515e-14 Are we doing something wrong with the preconditioner code in PetscLinearSolver::adjoint_solve()? My first thought: maybe the preconditioner isn't getting transposed properly, so asymmetric preconditioners like ILU show inconsistent behavior? You've boiled down the problem to a symmetric matrix, but IIRC ILU application still won't be symmetric. If we *tell* PETSc to precondition for a symmetric matrix, with "-pc_type icc", then everything still works fine... --- Roy ------------------------------------------------------------------------------ Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net _______________________________________________ Libmesh-devel mailing list Libmesh-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libmesh-devel