[petsc-users] [EXT]Re: reuse Mumps factorization for multiple RHS

Anthony Paul Haas aph at email.arizona.edu
Wed Aug 5 13:27:03 CDT 2020


Awesome! thanks to all.

Anthony

On Tue, Aug 4, 2020 at 7:28 PM Zhang, Hong <hzhang at mcs.anl.gov> wrote:

> *External Email*
> See case '"-num_rhs" in petsc/src/ksp/ksp/tests/ex30.c
>
> Hong
>
>
>
> ------------------------------
> *From:* petsc-users <petsc-users-bounces at mcs.anl.gov> on behalf of
> Matthew Knepley <knepley at gmail.com>
> *Sent:* Tuesday, August 4, 2020 7:29 PM
> *To:* Anthony Paul Haas <aph at email.arizona.edu>
> *Cc:* petsc-users <petsc-users at mcs.anl.gov>
> *Subject:* Re: [petsc-users] reuse Mumps factorization for multiple RHS
>
> On Tue, Aug 4, 2020 at 7:57 PM Anthony Paul Haas <aph at email.arizona.edu>
> wrote:
>
> Hello,
>
> When using Mumps to solve a linear system of equations (see below), can I
> reuse the factorization to solve for multiple RHS, ie, can I use KSPSolve multiple
> times while only building a different RHS in between the calls to KSPSolve
> ?
>
>
> Yes. It should detect that you have not changed the operator for the KSP
> and thus not refactor the matrix.
>
>   Thanks,
>
>      Matt
>
>
> Thanks,
>
> Anthony
>
> call KSPSetType(self%ksp,KSPPREONLY,self%ierr_ps)
>
> call KSPGetPC(self%ksp,pc,self%ierr_ps)
>
>
>
>
>
> call PCSetType(pc,PCLU,self%ierr_ps)
>
>
>
>
>
> call PCFactorSetMatSolverPackage(pc,MATSOLVERMUMPS,self%ierr_ps)
>
> call PCFactorSetUpMatSolverPackage(pc,self%ierr_ps)
>
>
>
> --
> 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/20200805/2275f48f/attachment.html>


More information about the petsc-users mailing list