Re: [petsc-users] Solve Linear System with Field Split Preconditioner

2022-09-26 Thread 晓峰 何
Hi Barry, A00 is formed from elliptic operator. I tried GAMG with A00, but it was extremely slow to solve the system with field-split preconditioner(I’m not sure I did it with the right way). Thanks, Xiaofeng On Sep 26, 2022, at 23:11, Barry Smith mailto:bsm...@petsc.dev>> wrote: What is

Re: [petsc-users] Strange mpi timing and CPU load when -np > 2

2022-09-26 Thread Barry Smith
It is important to check out https://petsc.org/main/faq/?highlight=faq#why-is-my-parallel-solver-slower-than-my-sequential-solver-or-i-have-poor-speed-up In

Re: [petsc-users] Strange mpi timing and CPU load when -np > 2

2022-09-26 Thread Matthew Knepley
On Mon, Sep 26, 2022 at 12:40 PM Duan Junming via petsc-users < petsc-users@mcs.anl.gov> wrote: > Dear all, > > I am using PETSc 3.17.4 on a Linux server, compiling > with --download-exodus --download-hdf5 --download-openmpi > --download-triangle --with-fc=0 --with-debugging=0 >

[petsc-users] Strange mpi timing and CPU load when -np > 2

2022-09-26 Thread Duan Junming via petsc-users
Dear all, I am using PETSc 3.17.4 on a Linux server, compiling with --download-exodus --download-hdf5 --download-openmpi --download-triangle --with-fc=0 --with-debugging=0 PETSC_ARCH=arch-linux-c-opt COPTFLAGS="-g -O3" CXXOPTFLAGS="-g -O3". The strange thing is when I run my code with mpirun

Re: [petsc-users] Solve Linear System with Field Split Preconditioner

2022-09-26 Thread Barry Smith
What is your A00 operator? ILU is almost never a good choice for large scale problems. If it is an elliptic operator that using a PC of gamg may work well for the A00 preconditioner instead of ILU. Barry For moderate size problems you can use a PC type LU for AOO to help you

Re: [petsc-users] Solve Linear System with Field Split Preconditioner

2022-09-26 Thread 晓峰 何
Hello Matt, Many thanks for your suggestion. BR, Xiaofeng On Sep 26, 2022, at 20:29, Matthew Knepley mailto:knep...@gmail.com>> wrote: Another option are the PCPATCH solvers for multigrid, as shown in this paper: https://arxiv.org/abs/1912.08516 which I believe solves incompressible

Re: [petsc-users] Solve Linear System with Field Split Preconditioner

2022-09-26 Thread 晓峰 何
Hello Jed, The saddle point is due to Lagrange multipliers, thus the size of A11 is much smaller than A00. Best Regards, Xiaofeng On Sep 26, 2022, at 21:03, Jed Brown mailto:j...@jedbrown.org>> wrote: Lagrange multipliers

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

Re: [petsc-users] Solve Linear System with Field Split Preconditioner

2022-09-26 Thread Jed Brown
Xiaofeng, is your saddle point due to incompressibility or other constraints (like Lagrange multipliers for contact or multi-point constraints)? If incompressibility, are you working on structured or unstructured/non-nested meshes? Matthew Knepley writes: > Another option are the PCPATCH

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

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] Solve Linear System with Field Split Preconditioner

2022-09-26 Thread Matthew Knepley
Another option are the PCPATCH solvers for multigrid, as shown in this paper: https://arxiv.org/abs/1912.08516 which I believe solves incompressible elasticity. There is an example in PETSc for Stokes I believe. Thanks, Matt On Mon, Sep 26, 2022 at 5:20 AM 晓峰 何 wrote: > Are there other

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] Solve Linear System with Field Split Preconditioner

2022-09-26 Thread 晓峰 何
Are there other approaches to solve this kind of systems in PETSc except for field-split methods? Thanks, Xiaofeng On Sep 26, 2022, at 14:13, Jed Brown mailto:j...@jedbrown.org>> wrote: This is the joy of factorization field-split methods. The actual Schur complement is dense, so we

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

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

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,

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 >

Re: [petsc-users] Solve Linear System with Field Split Preconditioner

2022-09-26 Thread Jed Brown
This is the joy of factorization field-split methods. The actual Schur complement is dense, so we represent it implicitly. A common strategy is to assemble the mass matrix and drop it in the 11 block of the Pmat. You can check out some examples in the repository for incompressible flow (Stokes