[petsc-dev] [petsc-users] Multiple solves with PCMG fail
Jed Brown
jed at jedbrown.org
Wed Oct 22 01:25:55 CDT 2014
Barry Smith <bsmith at mcs.anl.gov> writes:
> Jed
>
> There are some additional issues when the GMRES runs for zero iterations in computing eigenvalues for Cheby.
Hmm, what is right? Suggest that the user set
-ksp_chebyshev_estimate_eigenvalues_random? Automatically fall back to
that?
Just picking arbitrary values doesn't seem right because the solver
won't work right on the next solve.
> static PetscErrorCode KSPChebyshevComputeExtremeEigenvalues_Private(KSP kspest,PetscReal *emin,PetscReal *emax)
> {
> PetscErrorCode ierr;
> PetscInt n,neig;
> PetscReal *re,*im,min,max;
>
> PetscFunctionBegin;
> ierr = KSPGetIterationNumber(kspest,&n);CHKERRQ(ierr);
> ierr = PetscMalloc2(n,&re,n,&im);CHKERRQ(ierr);
> ierr = KSPComputeEigenvalues(kspest,n,re,im,&neig);CHKERRQ(ierr);
> min = PETSC_MAX_REAL;
> max = PETSC_MIN_REAL;
> for (n=0; n<neig; n++) {
> min = PetscMin(min,re[n]);
> max = PetscMax(max,re[n]);
> }
> ierr = PetscFree2(re,im);CHKERRQ(ierr);
> *emax = max;
> *emin = min;
>
> * 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
> frame #0: 0x00000001041b6777 libpetsc.3.5.dylib`KSPSolve_Chebyshev(ksp=0x00007fb85197ac60) + 1495 at cheby.c:378
> 375 cheb->emin = cheb->tform[0]*min + cheb->tform[1]*max;
> 376 cheb->emax = cheb->tform[2]*min + cheb->tform[3]*max;
> 377
> -> 378 cheb->estimate_current = PETSC_TRUE;
> 379 }
> 380
> 381 ksp->its = 0;
> (lldb) p cheb->emin
> (PetscReal) $11 = -1.7976931348623158E+307
> (lldb) p cheb->emax
> (PetscReal) $12 = -Inf
>
> This puts giberish into the eigenvalue estimates.
>
> I am not sure how you want to handle this?
>
> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20141022/a1126c64/attachment.sig>
More information about the petsc-dev
mailing list