Re: [petsc-users] Quasi newton

2022-05-03 Thread Jed Brown
If you have a problem that's close to a variational minimization, you can start with this -snes_type qn -snes_qn_scale_type jacobian -snes_linesearch_type cp It's L-BFGS and Jacobian scaling with a Powell update and critical point line search. Such methods are mentioned in some nonlinear

Re: [petsc-users] error with version 3.17.1

2022-05-03 Thread Mark Adams
I'm glad that was easy to deal with. We need to clarify this. Thanks, Mark On Tue, May 3, 2022 at 5:55 PM Randall Mackie wrote: > > On May 3, 2022, at 12:37 PM, Mark Adams wrote: > > >> Are you saying that now you have to explicitly set each 3x3 dense block, >> even if they are not used and

Re: [petsc-users] error with version 3.17.1

2022-05-03 Thread Randall Mackie
> On May 3, 2022, at 12:37 PM, Mark Adams wrote: > > >> Are you saying that now you have to explicitly set each 3x3 dense block, >> even if they are not used and that was not the case before? > > That was always the case before, you may have misinterpreted the meaning of a > Mat block size?

Re: [petsc-users] Preconditioning Diagnostics

2022-05-03 Thread Matthew Knepley
On Tue, May 3, 2022 at 3:28 PM Barry Smith wrote: > > A difficult question with no easy answers. > > First, do you have a restart system so you can save your state just > before your "bad behavior" and run experiments easily at the bad point? > > You could try to use SLEPc to compute the

Re: [petsc-users] error with version 3.17.1

2022-05-03 Thread Mark Adams
> > > Are you saying that now you have to explicitly set each 3x3 dense block, > even if they are not used and that was not the case before? > > > That was always the case before, you may have misinterpreted the meaning > of a Mat block size? > Actually block size is really more of a hint in that

Re: [petsc-users] Preconditioning Diagnostics

2022-05-03 Thread Barry Smith
A difficult question with no easy answers. First, do you have a restart system so you can save your state just before your "bad behavior" and run experiments easily at the bad point? You could try to use SLEPc to compute the first few eigenmodes (presumably associated with excessively

Re: [petsc-users] error with version 3.17.1

2022-05-03 Thread Pierre Jolivet
> On 3 May 2022, at 7:33 PM, Randall Mackie wrote: > > Hi Pierre, > > I do not discount that I might not be doing something right. > > However, this code has not changed and worked fine for versions up to and > including 3.16. What are you implying? It is not because a code works that it

Re: [petsc-users] error with version 3.17.1

2022-05-03 Thread Randall Mackie
Hi Pierre, I do not discount that I might not be doing something right. However, this code has not changed and worked fine for versions up to and including 3.16. Can you please explain what changed in 3.17 that is causing this? Are you saying that now you have to explicitly set each 3x3 dense

Re: [petsc-users] error with version 3.17.1

2022-05-03 Thread Pierre Jolivet
> On 3 May 2022, at 6:54 PM, Randall Mackie wrote: > > Hi Pierre, > > Here is how I create the matrix, and how I’ve done it for many years: > > ! Create global matrix to hold system of equations resulting from > finite discretization > ! of the Maxwell equations. >

Re: [petsc-users] error with version 3.17.1

2022-05-03 Thread Randall Mackie
Hi Pierre, Here is how I create the matrix, and how I’ve done it for many years: ! Create global matrix to hold system of equations resulting from finite discretization ! of the Maxwell equations. ngrow3=ginfo%nx*ginfo%ny*ginfo%nz*3 call MatCreate(comm,A,ierr)

Re: [petsc-users] error with version 3.17.1

2022-05-03 Thread Pierre Jolivet
Thanks for the reproducer. My guess is that your AIJ matrix has not a block size of 3. A simple call such as: call MatConvert(A,MATBAIJ,MAT_INITIAL_MATRIX,C,ierr) is also failing, while it shouldn’t if your AIJ Mat is truly made of 3x3 dense blocks. How did you determine the block size of your

Re: [petsc-users] Quasi newton

2022-05-03 Thread Tang, Qi
This is very helpful. JFNK + Qn in that paper sounds really promising. Jed, is there a flag I can quickly try to recover some performance related to that paper (snes ex48.c)? Thanks. Qi On May 3, 2022, at 7:27 AM, Matthew Knepley wrote:  On Tue, May 3, 2022 at 9:08 AM Tang, Qi

Re: [petsc-users] error with version 3.17.1

2022-05-03 Thread Pierre Jolivet
Please send to petsc-ma...@mcs.anl.gov I’ll have a look, I introduced that check. Thanks, Pierre > On 3 May 2022, at 5:39 PM, Randall Mackie wrote: > > Dear PETSc team: > > A part of our code that has worked for years and previous versions is now > failing

[petsc-users] Preconditioning Diagnostics

2022-05-03 Thread Alfredo J Duarte Gomez
Good morning PETSC team, I have a bit of an open question on diagnosing preconditioner performance. For a bit of background, I am using the TS object in combination with the matrix-free snes, and a custom user defined preconditioner (PCSHELL). Everything is implemented with the help of a DMDA.

[petsc-users] error with version 3.17.1

2022-05-03 Thread Randall Mackie
Dear PETSc team: A part of our code that has worked for years and previous versions is now failing with the latest version 3.17.1, on the KSP solve with the following error: [0]PETSC ERROR: - Error Message --

Re: [petsc-users] Quasi newton

2022-05-03 Thread Matthew Knepley
On Tue, May 3, 2022 at 9:08 AM Tang, Qi wrote: > Pierre and Matt, > > Thanks a lot for the suggestion. It looks like lag Jacobian is exactly > what I need. We will try that. > > I always thought ngmres is a fancy version of Anderson. Is there any > reference or example related to what you said

Re: [petsc-users] Quasi newton

2022-05-03 Thread Tang, Qi
Pierre and Matt, Thanks a lot for the suggestion. It looks like lag Jacobian is exactly what I need. We will try that. I always thought ngmres is a fancy version of Anderson. Is there any reference or example related to what you said in which one actually implemented an approximated Jacobian

Re: [petsc-users] Quasi newton

2022-05-03 Thread Matthew Knepley
On Tue, May 3, 2022 at 2:58 AM Pierre Seize wrote: > Hi, > > If I may, is this what you want ? > > https://petsc.org/main/docs/manualpages/SNES/SNESSetLagJacobian.html Yes, this is a good suggestion. Also, you could implement an approximation to the Jacobian. You could then improve it at

Re: [petsc-users] Quasi newton

2022-05-03 Thread Pierre Seize
Hi, If I may, is this what you want ? https://petsc.org/main/docs/manualpages/SNES/SNESSetLagJacobian.html Pierre On 03/05/2022 06:21, Tang, Qi wrote: Hi, Our code uses FDcoloring to compute Jacobian. The log file indicates most of time is spent in evaluating residual (2600 times in one