[petsc-users] max_it for EPS minres preconditioner

Pieter Ghysels pghysels at lbl.gov
Thu Apr 4 13:45:22 CDT 2019


Hi,

I'm trying to set the maximum number of iterations in a minres
preconditioner for the lobpcg eigensolver from SLEPc.
Using KSPSetTolerances, I can change the minres tolerance, but not maxit
(it's always 5).

  ierr = EPSCreate( PETSC_COMM_WORLD , &eps ) ;              CHKERRQ( ierr
) ;
  ...

  ST st;
  KSP ksp;
  PC pc;
  ierr = EPSGetST( eps , &st ) ;                             CHKERRQ( ierr
) ;
  ierr = STSetType( st, STPRECOND ) ;                        CHKERRQ( ierr
) ;
  ierr = STGetKSP( st , &ksp ) ;                             CHKERRQ( ierr
) ;
  ierr = KSPSetType( ksp , KSPMINRES ) ;                     CHKERRQ( ierr
) ;
  ierr = KSPGetPC( ksp , &pc ) ;                             CHKERRQ( ierr
) ;
  ierr = PCSetType( pc , PCNONE ) ;                          CHKERRQ( ierr
) ;
*  ierr = KSPSetTolerances*
*    ( ksp , /*tol_prec*/ 1e-10 , PETSC_DEFAULT , PETSC_DEFAULT ,
/*maxit_prec*/ 7 ) ;*
  CHKERRQ( ierr ) ;
  ierr = KSPSetFromOptions( ksp ) ;                          CHKERRQ( ierr
) ;
  ierr = STSetFromOptions( st ) ;                            CHKERRQ( ierr
) ;
  ierr = EPSSetFromOptions( eps ) ;                          CHKERRQ( ierr
) ;

  ...
 ierr = EPSSetOperators( eps , mat , NULL ) ;             CHKERRQ( ierr ) ;

 ierr = EPSSolve( eps ) ;                                 CHKERRQ( ierr ) ;



When I run with -eps_view, I see:

...
EPS Object: 4 MPI processes
  type: lobpcg
...
ST Object: 4 MPI processes
  type: precond
  shift: 0.
  number of matrices: 1
  KSP Object: (st_) 4 MPI processes
    type: minres
*    maximum iterations=5, initial guess is zero*
*    tolerances:  relative=1e-10, absolute=1e-50, divergence=10000.*
    left preconditioning
    using PRECONDITIONED norm type for convergence test
  PC Object: (st_) 4 MPI processes
    type: none
...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20190404/60facacc/attachment.html>


More information about the petsc-users mailing list