[petsc-users] Provide Matrix Factorization to EPS for Generalized Eigenvalue Problem

Jose E. Roman jroman at dsic.upv.es
Wed Nov 2 09:55:57 CDT 2016


> El 2 nov 2016, a las 14:55, Peetz, Darin T <peetz2 at illinois.edu> escribió:
> 
> I don't fully understand what the empty KSP is doing either, because it seems to me that if a KSP object was properly destroyed, KSPCreate() should have to be called again before it is used again, right?  So it must not be fully destroyed or else the second linear system solve would fail, but something is happening to it such that the symbolic factorization is redone.
> 
> Like I said, the fix I implemented seems to work (even if it doesn't seem necessary), so I don't know that it really needs any more attention.  However, I was able to reproduce the behavior in the example you sent me.  If you're curious, running the program as normal should behave the same way as the original example.  Running with the option "-destroy_eps" destroys and recreates the EPS object, and running with the additional option "-empty_ksp" gives the EPS object an empty KSP before it is destroyed.  At least when I ran it on my machine, I got 1 symbolic factorization for the original program, 2 with the "-destroy_eps" option, and 1 with both "-destroy_eps" and "-empty_ksp".
> 
> Thanks,
> Darin

The -empty_ksp option does not work for me because, first, the compiler gives a warning about an uninitialized variable "empty", and second if I initialize empty=NULL then STSetKSP() fails because the ksp argument is not valid.

Regarding the -destroy_eps option, the explanation is the following: when EPSDestroy() is called the following sequence of calls
  EPSDestroy --> EPSReset --> STReset --> KSPReset
results in the assignment
  ksp->setupstage = KSP_SETUP_NEW
That makes a difference because then the next call to KSPSolve will force a setup (including the symbolic factorization).

Jose



More information about the petsc-users mailing list