On Thu, 8 Jan 2015, Jed Brown wrote:

>>   10 KSP preconditioned resid norm 1.580464771307e-13 true resid norm 
>> 3.084021824157e-04 ||r(i)||/||b|| 2.711608086867e-03
>> number of iterations to solve adjoint: 10 final residual of adjoint solve: 
>> 1.58046e-13
>
> This is usually caused by a singular preconditioner.

> http://mid.mail-archive.com/87y6iyzl73.fsf@59A2.org

Thanks!  Is there a workaround that avoids false positives in such
cases?  I've tried (with PETSc 3.5.2) "-ksp_pc_side right" and
"-ksp_type bcgs -ksp_norm_type unpreconditioned", but neither seems to
do much.

It's odd that incomplete LU would be singular but incomplete Cholesky
would work fine, too, isn't it?

On the other hand, this is nothing like a diagonally-dominant matrix,
so I wouldn't be surprised to see either of those screwing up in
interesting ways.

>> It still seems like we've got to be doing something wrong in
>> PetscLinearSolver::adjoint_solve().  I haven't tried this myself, but
>> I'm told that setting up the transpose linearized problem here and
>> using a straight solve() works fine.
>
> What solver configuration is being used?  Can you show
> -ksp_monitor_true_residual output for the original forward solve and the
> explicitly transposed solve?

Okay, I take back the above.  When I try this myself, doing a *linear*
forward solve from a zero initial guess, the behavior is nearly the
same as for the linear adjoint solve.  (I am a little disturbed by
"nearly the same" for a symmetric matrix)


Adjoint solve:
   0 KSP preconditioned resid norm 5.893300515271e-01 true resid norm 
1.137340546775e-01 ||r(i)||/||b|| 1.000000000000e+00
   1 KSP preconditioned resid norm 1.323095860276e-01 true resid norm 
1.854948903571e-02 ||r(i)||/||b|| 1.630952935627e-01
   2 KSP preconditioned resid norm 2.957976209084e-03 true resid norm 
9.076848423484e-04 ||r(i)||/||b|| 7.980765698734e-03
   3 KSP preconditioned resid norm 4.630654713249e-04 true resid norm 
3.394455698647e-04 ||r(i)||/||b|| 2.984555248884e-03
   4 KSP preconditioned resid norm 1.042927953583e-05 true resid norm 
3.082072165862e-04 ||r(i)||/||b|| 2.709893861255e-03
   5 KSP preconditioned resid norm 7.161971654746e-07 true resid norm 
3.084038310662e-04 ||r(i)||/||b|| 2.711622582529e-03
   6 KSP preconditioned resid norm 3.126650757674e-08 true resid norm 
3.084036219553e-04 ||r(i)||/||b|| 2.711620743934e-03
   7 KSP preconditioned resid norm 1.102895578517e-09 true resid norm 
3.084021853448e-04 ||r(i)||/||b|| 2.711608112620e-03
   8 KSP preconditioned resid norm 5.540930099957e-11 true resid norm 
3.084021840854e-04 ||r(i)||/||b|| 2.711608101548e-03
   9 KSP preconditioned resid norm 2.937449992531e-12 true resid norm 
3.084021825944e-04 ||r(i)||/||b|| 2.711608088437e-03
  10 KSP preconditioned resid norm 1.580464771307e-13 true resid norm 
3.084021824157e-04 ||r(i)||/||b|| 2.711608086867e-03


Linear forward solve:
   0 KSP preconditioned resid norm 5.893175435351e-01 true resid norm 
1.137340546775e-01 ||r(i)||/||b|| 1.000000000000e+00
   1 KSP preconditioned resid norm 1.323059758093e-01 true resid norm 
1.854739741057e-02 ||r(i)||/||b|| 1.630769030715e-01
   2 KSP preconditioned resid norm 2.926513590091e-03 true resid norm 
9.072530459119e-04 ||r(i)||/||b|| 7.976969153912e-03
   3 KSP preconditioned resid norm 4.631266360016e-04 true resid norm 
3.185176705725e-04 ||r(i)||/||b|| 2.800547922745e-03
   4 KSP preconditioned resid norm 1.075300967442e-05 true resid norm 
2.824015720242e-04 ||r(i)||/||b|| 2.482999246135e-03
   5 KSP preconditioned resid norm 5.982748177679e-07 true resid norm 
2.825507661757e-04 ||r(i)||/||b|| 2.484311026956e-03
   6 KSP preconditioned resid norm 2.632996665496e-08 true resid norm 
2.825588496190e-04 ||r(i)||/||b|| 2.484382100156e-03
   7 KSP preconditioned resid norm 2.222034839878e-09 true resid norm 
2.825586756678e-04 ||r(i)||/||b|| 2.484380570700e-03
   8 KSP preconditioned resid norm 1.814426836084e-10 true resid norm 
2.825586967601e-04 ||r(i)||/||b|| 2.484380756153e-03
   9 KSP preconditioned resid norm 2.844498948759e-12 true resid norm 
2.825586987199e-04 ||r(i)||/||b|| 2.484380773384e-03
  10 KSP preconditioned resid norm 8.360209016600e-14 true resid norm 
2.825586987717e-04 ||r(i)||/||b|| 2.484380773840e-03


*repeated* linear forward solves (using the solution of one as initial
iterate for the next) work, so perhaps NewtonSolver or PetscDiffSolver
was what was making up for the bad preconditioning.
---
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

Reply via email to