Hi Thomas,<div>Does this behaviour only occur when using ml, or do you see this with other preconditioners as well?</div><div><br></div><div><span></span><br><br>On Thursday, 27 June 2013, Thomas DE-SOZA  wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br><font face="sans-serif">Dear PETSc users,</font>
<br>
<br><font face="sans-serif">We've been using the Krylov solvers
in PETSc for a while in our software package for implicit structural mechanics
and recently added algebraic multigrid preconditioning through the ML and
Hypre libraries provided as part of PETSc.</font>
<br><font face="sans-serif">Though we're quite happy with this new
feature, we've encountered a strange behaviour when using KSPGCR in conjunction
with the PCML preconditioner. </font>
<br><font face="sans-serif">Indeed, identical and  consecutives
solves inside the same run do not display the same number of Krylov iterations
even in sequential and we were wondering why :</font>
<br>
<br><font face="sans-serif">1st solve</font>
<br><font face="sans-serif">723 KSP unpreconditioned resid norm
2.911385065051e-02 true resid norm 2.911385065051e-02 ||r(i)||/||b|| 9.979426047969e-09</font>
<br>
<br><font face="sans-serif">2nd solve</font>
<br><font face="sans-serif">787 KSP unpreconditioned resid norm
2.896035212670e-02 true resid norm 2.896035212670e-02 ||r(i)||/||b|| 9.926810982197e-09</font>
<br>
<br><font face="sans-serif">3rd solve</font>
<br><font face="sans-serif">721 KSP unpreconditioned resid norm
2.913123687343e-02 true resid norm 2.913123687343e-02 ||r(i)||/||b|| 9.985385566274e-09</font>
<br>
<br>
<br><font face="sans-serif">Would you say this case requires a great
number of iterations and therefore reproductibility is not ensured (indeed
it is ill-conditioned and is not very suited for algebraic multigrid) ?</font>
<br><font face="sans-serif">Or is there a seed somewhere in ML that
would explain this ? I searched the ML manual for that and couln't find
any. We're using the uncoupled coarsening scheme in ML (call PetscOptionsSetValue('-pc_ml_CoarsenScheme',
'Uncoupled', ierr)).</font>
<br>
<br><font face="sans-serif">Final notes : several consecutive runs
of the program do display identical behaviour (that is the 1st solve always
require 723 iterations, the 2nd 787, etc). Moreover other cases that are
well-conditioned require the same number number of iterations for each
consecutive solve (though the converged residual differs a bit).</font>
<br>
<br><font face="sans-serif">Thanks for any hints,</font>
<br><font face="sans-serif">Thomas</font></blockquote></div>