[petsc-users] SLEPc solve: progress info and abort option
Matthew Knepley
knepley at gmail.com
Mon Mar 7 05:36:26 CST 2022
On Mon, Mar 7, 2022 at 6:23 AM Jose E. Roman <jroman at dsic.upv.es> wrote:
>
>
> > El 7 mar 2022, a las 12:00, Varun Hiremath <varunhiremath at gmail.com>
> escribió:
> >
> > Thanks, Matt and Jose! I have added a custom function to KSPMonitorSet,
> and that improves the response time for the abort option, however, it is
> still a bit slow for very big problems, but I think that is probably
> because I am using the MUMPS direct solver so likely a large amount of time
> is spent inside MUMPS. And I am guessing there is no way to get the
> progress info of MUMPS from PETSc?
>
Yes, we do not have a way of looking into MUMPS. You might see if they have
a suggestion.
Thanks,
Matt
> > Jose, for the progress bar I am using the number of converged
> eigenvalues (nconv) as obtained using EPSMonitorSet function. But this is
> slow as it is called only once every iteration, and typically many
> eigenvalues converge within an iteration, so is there any way to get more
> detailed/finer info on the solver progress?
>
> It is typical that Krylov solvers converge several eigenvalues at once.
> You can look at the residual norm of the first uncoverged eigenvalue to see
> "how far" you are from convergence. But convergence may be irregular. You
> can also try reducing the ncv parameter, so that the monitor is called more
> often, but this will probably slow down convergence.
>
> Jose
>
>
> >
> > Many thanks for your help.
> >
> > Thanks,
> > Varun
> >
> > On Fri, Mar 4, 2022 at 11:36 AM Jose E. Roman <jroman at dsic.upv.es
> <mailto:jroman at dsic.upv.es>> wrote:
> > Yes, assuming that the eigensolver is calling KSPSolve(), you can set a
> monitor with KSPMonitorSet(). This will be called more often than the
> callback for EPSSetStoppingTestFunction().
> >
> > Jose
> >
> > > El 4 mar 2022, a las 20:16, Matthew Knepley <knepley at gmail.com
> <mailto:knepley at gmail.com>> escribió:
> > >
> > >
> > > On Fri, Mar 4, 2022 at 2:07 PM Varun Hiremath <varunhiremath at gmail.com
> <mailto:varunhiremath at gmail.com>> wrote:
> > > Hi All,
> > >
> > > We use SLEPc to compute eigenvalues of big problems which typically
> takes a long time. We want to add a progress bar to inform the user of the
> estimated time remaining to finish the computation. In addition, we also
> want to add an option for the user to abort the computation midway if
> needed.
> > >
> > > To some extent, I am able to do these by attaching a custom function
> to EPSSetStoppingTestFunction and using nconv/nev as an indication of
> progress, and throwing an exception when the user decides to abort the
> computation. However, since this function gets called only once every
> iteration, for very big problems it takes a long time for the program to
> respond. I was wondering if there is any other function to which I can
> attach, which gets called more frequently and can provide more fine-grained
> information on the progress.
> > >
> > > I believe (Jose can correct me) that the bulk of the time in an
> iterate would be in the linear solve. You can insert something into a
> KSPMonitor. If you know the convergence tolerance and assume a linear
> convergence rate I guess you could estimate the "amount done".
> > >
> > > Thanks,
> > >
> > > Matt
> > >
> > > Thanks,
> > > Varun
> > >
> > >
> > > --
> > > What most experimenters take for granted before they begin their
> experiments is infinitely more interesting than any results to which their
> experiments lead.
> > > -- Norbert Wiener
> > >
> > > https://www.cse.buffalo.edu/~knepley/ <
> https://www.cse.buffalo.edu/~knepley/>
> >
>
>
--
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20220307/f25941cb/attachment-0001.html>
More information about the petsc-users
mailing list