Re: [petsc-users] Problem solving Ax=b with rectangular matrix A

2022-09-26 Thread Pierre Jolivet
> On 26 Sep 2022, at 2:52 PM, fujisan wrote: > > Ok, Thank you. > I didn't know about MatCreateNormal. > > In terms of computer performance, what is best to solve Ax=b with A > rectangular? > Is it to keep A rectangular and use KSPLSQR along with PCNONE or > to convert to normal equations usi

Re: [petsc-users] Problem solving Ax=b with rectangular matrix A

2022-09-26 Thread Matthew Knepley
On Mon, Sep 26, 2022 at 8:52 AM fujisan wrote: > Ok, Thank you. > I didn't know about MatCreateNormal. > > In terms of computer performance, what is best to solve Ax=b with A > rectangular? > Is it to keep A rectangular and use KSPLSQR along with PCNONE or > to convert to normal equations using M

Re: [petsc-users] Problem solving Ax=b with rectangular matrix A

2022-09-26 Thread fujisan
Ok, Thank you. I didn't know about MatCreateNormal. In terms of computer performance, what is best to solve Ax=b with A rectangular? Is it to keep A rectangular and use KSPLSQR along with PCNONE or to convert to normal equations using MatCreateNormal and use another ksp type with another pc type?

Re: [petsc-users] Problem solving Ax=b with rectangular matrix A

2022-09-26 Thread Pierre Jolivet
I’m sorry, solving overdetermined systems, alongside (overlapping) domain decomposition preconditioners and solving systems with multiple right-hand sides, is one of the topic for which I need to stop pushing new features and update the users manual instead… The very basic documentation of PCQR

Re: [petsc-users] Problem solving Ax=b with rectangular matrix A

2022-09-26 Thread fujisan
OK thank you. On Mon, Sep 26, 2022 at 10:53 AM Jose E. Roman wrote: > The QR factorization from SuiteSparse is sequential only, cannot be used > in parallel. > In parallel you can try PCBJACOBI with a PCQR local preconditioner. > Pierre may have additional suggestions. > > Jose > > > > El 26 sep

Re: [petsc-users] Problem solving Ax=b with rectangular matrix A

2022-09-26 Thread Jose E. Roman
The QR factorization from SuiteSparse is sequential only, cannot be used in parallel. In parallel you can try PCBJACOBI with a PCQR local preconditioner. Pierre may have additional suggestions. Jose > El 26 sept 2022, a las 10:47, fujisan escribió: > > I did configure Petsc with the option --

Re: [petsc-users] Problem solving Ax=b with rectangular matrix A

2022-09-26 Thread fujisan
I did configure Petsc with the option --download-suitesparse. The error is more like this: PETSC ERROR: Could not locate a solver type for factorization type QR and matrix type mpiaij. Fuji On Mon, Sep 26, 2022 at 10:25 AM Jose E. Roman wrote: > If the error message is "Could not locate a solv

Re: [petsc-users] Problem solving Ax=b with rectangular matrix A

2022-09-26 Thread Jose E. Roman
If the error message is "Could not locate a solver type for factorization type QR" then you should configure PETSc with --download-suitesparse Jose > El 26 sept 2022, a las 9:06, fujisan escribió: > > Thank you Pierre, > > I used PCNONE along with KSPLSQR and it worked. > But as for PCQR, it

Re: [petsc-users] Problem solving Ax=b with rectangular matrix A

2022-09-26 Thread fujisan
Thank you Pierre, I used PCNONE along with KSPLSQR and it worked. But as for PCQR, it cannot be found. There is nothing about it in the documentation as well. Fuji On Wed, Sep 21, 2022 at 12:20 PM Pierre Jolivet wrote: > Yes, but you need to use a KSP that handles rectangular Mat, such as > KS

Re: [petsc-users] Problem solving Ax=b with rectangular matrix A

2022-09-21 Thread Pierre Jolivet
Yes, but you need to use a KSP that handles rectangular Mat, such as KSPLSQR (-ksp_type lsqr). PCLU does not handle rectangular Pmat. The only PC that handle rectangular Pmat are PCQR, PCNONE. If you supply the normal equations as the Pmat for LSQR, then you can use “standard” PC. You can have a

[petsc-users] Problem solving Ax=b with rectangular matrix A

2022-09-21 Thread fujisan
I'm trying to solve Ax=b with a sparse rectangular matrix A (of size 33x17 in my test) using options '-ksp_type stcg -pc_type lu' on 1 or 2 cpus. And I always get an error saying "Incompatible vector local lengths" (see below). Here is the relevant lines of my code: program test ... ! Va