[petsc-users] Restart Krylov-Schur "Manually"

Matthew Knepley knepley at gmail.com
Mon Jun 24 10:41:48 CDT 2024


On Mon, Jun 24, 2024 at 11:38 AM Samar Khatiwala <
samar.khatiwala at earth.ox.ac.uk> wrote:

> Hi Matt,
>
> This would be for SNES and KSP. In many of my applications it would be too
> expensive to regenerate the Krylov space, which would also be problematic
> for Newton as I often do matrix-free calculations.
>
> I know how complex the underlying data structures are for these objects
> and entirely understand how difficult it would be to provide a general
> checkpointing facility. Still, I do dream that one day I’ll be able to do
> Save(snes,...) and Load(snes,…) ...
>

Let's talk specifically about SNES. I think this works now. It would be
good to find out why you think it does not. You can do
SNESView() and it will serialize the solver, and VecView() to serialize the
current solution. Then you SNESLoad() and VecLoad()
and call SNESSolve() with that solution as the initial guess.

  Thanks,

    Matt


> Thanks,
>
> Samar
>
> On Jun 24, 2024, at 12:15 PM, Matthew Knepley <knepley at gmail.com> wrote:
>
> On Mon, Jun 24, 2024 at 4:24 AM Samar Khatiwala <
> samar.khatiwala at earth.ox.ac.uk> wrote:
>
>> This Message Is From an External Sender
>> This message came from outside your organization.
>>
>> Hi,
>>
>> Sorry to hijack this thread but I just want to add that this is a more
>> general problem that I constantly face with PETSc. Not being able to
>> checkpoint the complete state of a solver instance and restart a
>> computation (at least not easily) has long been the biggest missing feature
>> in PETSc for me.
>>
>
> Which type of solver do you want to do this for? Some solvers, like
> Newton, just need the current iterate, which we do. You could imagine
> saving Krylov spaces, but it is very often cheaper to regenerate them than
> to save and load them from disk (which tends to be under-provisioned).
>
>   Thanks,
>
>     Matt
>
>
>> Thanks,
>>
>> Samar
>>
>> On Jun 24, 2024, at 9:14 AM, Jose E. Roman via petsc-users <
>> petsc-users at mcs.anl.gov> wrote:
>>
>> This Message Is From an External Sender
>> This message came from outside your organization.
>>
>> Unfortunately there is no support for this.
>>
>> If you requested several eigenvalues and the solver has converged some of them already, then it would be possible to stop the run, save the eigenvectors and rerun with the eigenvectors passed via EPSSetDeflationSpace().
>>
>> Jose
>>
>>
>> > El 24 jun 2024, a las 0:21, Marildo Kola <marildo.kola at gmail.com> escribió:
>> >
>> > This Message Is From an External Sender
>> > This message came from outside your organization.
>> > Hello,
>> > I am using SLEPc to calculate eigenvalues for fluid dynamics stability analysis (specifically studying bifurcations). We employ a MatShellOperation, which involves propagating Navier-Stokes to construct the Krylov space, and this particularly slows down our algorithm. The problem I am facing is that, after days of simulations, the simulation may die due to a time limit on the cluster, but the eigensolver (I am using the default Krylov-Schur) has not converged yet, leading to the loss of all the information computed up to that point. I wanted to inquire if it is possible to implement, with the available features, a restarting strategy, which can allow me, once the simulation stops (or after a given number of restart iterations of the solver), to save all the information necessary to restart the EPSSolver from the point it had stopped.
>> > Thank you in advance,
>> > Best regards, Marildo Kola
>>
>>
>>
>>
>>
>>
>
> --
> 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://urldefense.us/v3/__https://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!eqOVZGVAqNSjCctZz15A80QkgJt28WLpriJPEkHdcCiN1vrJ4RfXPebAjRgUJQsG16l6LF3_JF75uEgZQtwr$ 
> <https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!eqOVZGVAqNSjCctZz15A80QkgJt28WLpriJPEkHdcCiN1vrJ4RfXPebAjRgUJQsG16l6LF3_JF75uFfyfnKY$ >
>
>
>

-- 
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://urldefense.us/v3/__https://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!eqOVZGVAqNSjCctZz15A80QkgJt28WLpriJPEkHdcCiN1vrJ4RfXPebAjRgUJQsG16l6LF3_JF75uEgZQtwr$  <https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!eqOVZGVAqNSjCctZz15A80QkgJt28WLpriJPEkHdcCiN1vrJ4RfXPebAjRgUJQsG16l6LF3_JF75uFfyfnKY$ >
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20240624/a55e46c7/attachment.html>


More information about the petsc-users mailing list