how to reuse Mumps factorization
Hello, I am using Mumps to solve a problem with multiple time steps. The matrix structure does not change but its value may or may not change during those steps. That means I should reuse the symbolic factorization but recall numeric factorization when needed. I have found the following anwser of a similar question https://lists.mcs.anl.gov/pipermail/petsc-users/2020-August/041846.html which says "it automatically uses the same factorization", but I don't know if it includes numerical factorization also. My question is : 1. Does numeric factorization do automatically? If not 2. Could I control when numeric factorization should be done and how to do it? Much thanks YUAN
On Wed, Oct 19, 2022 at 9:13 AM 袁煕 <[email protected]> wrote:
Hello,
I am using Mumps to solve a problem with multiple time steps. The matrix structure does not change but its value may or may not change during those steps. That means I should reuse the symbolic factorization but recall numeric factorization when needed.
I have found the following anwser of a similar question https://lists.mcs.anl.gov/pipermail/petsc-users/2020-August/041846.html
which says "it automatically uses the same factorization", but I don't know if it includes numerical factorization also.
My question is : 1. Does numeric factorization do automatically? If not
Yes. Thanks, Matt
2. Could I control when numeric factorization should be done and how to do it?
Much thanks
YUAN
-- 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/>
Every time a matrix entry gets changes PETSc tracks these changes so for the next KSP by default solve it repeats the numerical factorization if the matrix has changed. Otherwise it reuses the still current factorization. If you are calling KSP directly, you can call KSPSetReusePreconditioner() to prevent KSP from automatically performing a new factorization, so it will use the out-of-date preconditioner but if you use a KSPType of, for example, KSPGMRES, it will still solve the linear system correctly just taking some iterations. Reusing the preconditioner can be faster if the matrix does not change too much since a numerical factorization takes a lot of time If you use SNES you can control "lagging" the preconditioner with SNESSetLagPreconditioner() Barry
On Oct 19, 2022, at 9:15 AM, Matthew Knepley <[email protected]> wrote:
On Wed, Oct 19, 2022 at 9:13 AM 袁煕 <[email protected] <mailto:[email protected]>> wrote: Hello,
I am using Mumps to solve a problem with multiple time steps. The matrix structure does not change but its value may or may not change during those steps. That means I should reuse the symbolic factorization but recall numeric factorization when needed.
I have found the following anwser of a similar question https://lists.mcs.anl.gov/pipermail/petsc-users/2020-August/041846.html <https://lists.mcs.anl.gov/pipermail/petsc-users/2020-August/041846.html>
which says "it automatically uses the same factorization", but I don't know if it includes numerical factorization also.
My question is : 1. Does numeric factorization do automatically? If not
Yes.
Thanks,
Matt
2. Could I control when numeric factorization should be done and how to do it?
Much thanks
YUAN
-- 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/>
Got it. Thanks for your detailed explanation. YUAN 2022年10月19日(水) 23:58 Barry Smith <[email protected]>:
Every time a matrix entry gets changes PETSc tracks these changes so for the next KSP by default solve it repeats the numerical factorization if the matrix has changed. Otherwise it reuses the still current factorization.
If you are calling KSP directly, you can call KSPSetReusePreconditioner() to prevent KSP from automatically performing a new factorization, so it will use the out-of-date preconditioner but if you use a KSPType of, for example, KSPGMRES, it will still solve the linear system correctly just taking some iterations. Reusing the preconditioner can be faster if the matrix does not change too much since a numerical factorization takes a lot of time
If you use SNES you can control "lagging" the preconditioner with SNESSetLagPreconditioner()
Barry
On Oct 19, 2022, at 9:15 AM, Matthew Knepley <[email protected]> wrote:
On Wed, Oct 19, 2022 at 9:13 AM 袁煕 <[email protected]> wrote:
Hello,
I am using Mumps to solve a problem with multiple time steps. The matrix structure does not change but its value may or may not change during those steps. That means I should reuse the symbolic factorization but recall numeric factorization when needed.
I have found the following anwser of a similar question https://lists.mcs.anl.gov/pipermail/petsc-users/2020-August/041846.html
which says "it automatically uses the same factorization", but I don't know if it includes numerical factorization also.
My question is : 1. Does numeric factorization do automatically? If not
Yes.
Thanks,
Matt
2. Could I control when numeric factorization should be done and how to do it?
Much thanks
YUAN
-- 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/>
participants (3)
-
Barry Smith -
Matthew Knepley -
袁煕