<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 22, 2014 at 2:25 AM, Jed Brown <span dir="ltr"><<a href="mailto:jed@jedbrown.org" target="_blank">jed@jedbrown.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Barry Smith <<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>> writes:<br>
<br>
> Jed<br>
><br>
> There are some additional issues when the GMRES runs for zero iterations in computing eigenvalues for Cheby.<br>
<br>
</span>Hmm, what is right? Suggest that the user set<br>
-ksp_chebyshev_estimate_eigenvalues_random? Automatically fall back to<br>
that?<br>
<br></blockquote><div><br></div><div>Are you implying that PETSc is using the RHS to compute the spectra for cheby?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Just picking arbitrary values doesn't seem right because the solver<br>
won't work right on the next solve.<br>
<div class="HOEnZb"><div class="h5"><br>
> static PetscErrorCode KSPChebyshevComputeExtremeEigenvalues_Private(KSP kspest,PetscReal *emin,PetscReal *emax)<br>
> {<br>
> PetscErrorCode ierr;<br>
> PetscInt n,neig;<br>
> PetscReal *re,*im,min,max;<br>
><br>
> PetscFunctionBegin;<br>
> ierr = KSPGetIterationNumber(kspest,&n);CHKERRQ(ierr);<br>
> ierr = PetscMalloc2(n,&re,n,&im);CHKERRQ(ierr);<br>
> ierr = KSPComputeEigenvalues(kspest,n,re,im,&neig);CHKERRQ(ierr);<br>
> min = PETSC_MAX_REAL;<br>
> max = PETSC_MIN_REAL;<br>
> for (n=0; n<neig; n++) {<br>
> min = PetscMin(min,re[n]);<br>
> max = PetscMax(max,re[n]);<br>
> }<br>
> ierr = PetscFree2(re,im);CHKERRQ(ierr);<br>
> *emax = max;<br>
> *emin = min;<br>
><br>
> * thread #1: tid = 0x3c16cf, 0x00000001041b6777 libpetsc.3.5.dylib`KSPSolve_Chebyshev(ksp=0x00007fb85197ac60) + 1495 at cheby.c:378, queue = 'com.apple.main-thread', stop reason = step over<br>
> frame #0: 0x00000001041b6777 libpetsc.3.5.dylib`KSPSolve_Chebyshev(ksp=0x00007fb85197ac60) + 1495 at cheby.c:378<br>
> 375 cheb->emin = cheb->tform[0]*min + cheb->tform[1]*max;<br>
> 376 cheb->emax = cheb->tform[2]*min + cheb->tform[3]*max;<br>
> 377<br>
> -> 378 cheb->estimate_current = PETSC_TRUE;<br>
> 379 }<br>
> 380<br>
> 381 ksp->its = 0;<br>
> (lldb) p cheb->emin<br>
> (PetscReal) $11 = -1.7976931348623158E+307<br>
> (lldb) p cheb->emax<br>
> (PetscReal) $12 = -Inf<br>
><br>
> This puts giberish into the eigenvalue estimates.<br>
><br>
> I am not sure how you want to handle this?<br>
><br>
> The zero right hand side zero, initial guess case is a great corner case for testing complicated solvers :-) I’d forgotten about it for many years<br>
</div></div></blockquote></div><br></div></div>