<div dir="ltr">PETSc developers,<div><br></div><div>I tried implementing a system for automatically increasing MUMPS ICNTL(14), along the lines described in this recent thread. If SNESSolve returns ierr .ne. 0 due to MUMPS error -9, I call SNESDestroy, re-initialize SNES, call MatMumpsSetIcntl with a larger value of ICNTL(14), call SNESSolve again, and repeat as needed. The procedure works, but the peak memory required (as measured by the HPC system) is 50%-100% higher if the MUMPS solve has to be repeated compared to when MUMPS works on the 1st try (by starting with a large ICNTL(14)), even though SNESDestroy is called in between the attempts. Are there some PETSc or MUMPS structures which would not be deallocated immediately by SNESDestroy?  If so, how do I deallocate them?</div><div><br></div><div>Thanks,</div><div>Matt Landreman</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 15, 2015 at 7:47 AM, David Knezevic <span dir="ltr"><<a href="mailto:david.knezevic@akselos.com" target="_blank">david.knezevic@akselos.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Tue, Sep 15, 2015 at 7:29 PM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span>On Tue, Sep 15, 2015 at 4:30 AM, David Knezevic <span dir="ltr"><<a href="mailto:david.knezevic@akselos.com" target="_blank">david.knezevic@akselos.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>In some cases, I get MUMPS error -9, i.e.:</div>[2]PETSC ERROR: Error reported by MUMPS in numerical factorization phase: INFO(1)=-9, INFO(2)=98927<div><br></div><div>This is easily fixed by re-running the executable with -mat_mumps_icntl_14 on the commandline.</div><div><br></div><div>However, I would like to update my code in order to do this automatically, i.e. detect the -9 error and re-run with the appropriate option. Is there a recommended way to do this? It seems to me that I could do this with a PETSc error handler (e.g. PetscPushErrorHandler) in order to call a function that sets the appropriate option and solves again, is that right? Are there any examples that illustrate this type of thing?</div></div></blockquote><div><br></div></span><div>I would not use the error handler. I would just check the ierr return code from the solver. I think you need the</div><div>INFO output, for which you can use MatMumpsGetInfo().</div></div></div></div></blockquote><div><br></div><div><br></div></span><div>OK, that sounds good (and much simpler than what I had in mind), thanks for the help!</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>David</div><div><br></div></font></span></div></div></div>
</blockquote></div><br></div>