<div dir="ltr">Good point. I can not see any reason to use the initial guess for the eigen estimate. I would vote for (1).<div><br></div><div>Also, I hope <span style="font-size:12.8000001907349px">cheb->random is the default. One of my apps uses a zero RHS for the first solve, just because they did not care about adding some logic like: if (.not. first_solve) solve() Using a zero RHS would be catastrophic. I trust this is true, because the code works, but we should make sure. And perhaps Cheby should check that that </span><span style="font-size:12.8000001907349px">KSPSolve did all of its iterations (ie, DIVERGE_ITS, or whatever). Getting this wrong leads to silent errors that are a pain to debug.</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">I can do this.</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">Mark</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Aug 22, 2015 at 6:35 PM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
From KSPSolve_Chebyshev()<br>
<br>
X = ksp->work[0];<br>
if (cheb->random) {<br>
B = ksp->work[1];<br>
ierr = VecSetRandom(B,cheb->random);CHKERRQ(ierr);<br>
} else {<br>
B = ksp->vec_rhs;<br>
}<br>
ierr = KSPSolve(cheb->kspest,B,X);CHKERRQ(ierr);<br>
<br>
if (ksp->guess_zero) {<br>
ierr = VecZeroEntries(X);CHKERRQ(ierr);<br>
}<br>
ierr = KSPChebyshevComputeExtremeEigenvalues_Private(cheb->kspest,&min,&max);CHKERRQ(ierr);<br>
<br>
This seems to do strange stuff with the initial guess for the eigenanalysis. ksp->work[0] is a work vector used within the Chebyshev algorithm, so at this point in the code it will have just whatever stuff it had in it from a previous Chebyshev solver or a zero the first time through. It seems bad to use this vector as the initial guess for estimator. Then AFTER the KSPSolve() it zeros ksp->work[0], sometimes? If the original system being solved has zero initial guess, even though the values in X will not be used again. WTF?<br>
<br>
Shouldn't the code either<br>
<br>
1) zero X = ksp->work[0] everytime BEFORE the KSPSolve() or<br>
2) zero X if ksp->guess_zero and otherwise copy into X the initial guess vec_sol from the caller before computing the eigenvalues to use that initial guess in estimating the eigenvalues?<br>
<span class="HOEnZb"><font color="#888888"><br>
Barry<br>
<br>
</font></span></blockquote></div><br></div>