[petsc-users] EPSSolve in a loop

Jed Brown jedbrown at mcs.anl.gov
Fri May 3 22:20:35 CDT 2013


Dharmendar Reddy <dharmareddy84 at gmail.com> writes:

> Hello,
>           I see an interesting behavior when i call EPSSolve in a loop. Can
> you help me figure out whats going on ?
>
> I have a setup like this to solve a A x = lambda B x   (Generalized
> Hermitian problem)
>
> type eigenSolver_t
>   EPS :: eps
>
> end type eigenSolver_t
>
> the type has bound procedure which calls  EPSSetOperators and EPSSolve when
> eigenSolver%solve() is called
>
> Now i run a for loop
>
> do ic=1,111
>   call eigenSolver(ic)%solve()
> end do
>
> I print the time for each solve.  The operators A,B =A1,B1 for ic=1 to 50
> A2,B2 for ic=51 to 80  and A3,B3 for ic=81 to 111
>
> Now i see that time per solve per ic is almost constant when i use
> -eps_type lapack.

How do you figure?  It looks like it increases by more than an order of
magnitude.

Always send -log_summary output when asking about performance.  In this
case, it would be nice to use a different stage to log each solve.

> But for, defualt solver, time per solve seem to increase with increasing
> ic. Have look at the attached timing information.
>
> Also, Time per solve using lapack is lower than any of the iterative
> solvers i have tried. Problem size is about 100 x 100, operators are
> tri-diagonal.

I'm not surprised.  That problem is tiny.


More information about the petsc-users mailing list