Re: [petsc-users] How to activate the modified Gram-Schmidt orthogonalization process in Fortran?

2020-09-11 Thread Zhuo Chen
Wow, thank you so much. Indeed, there is one output missing. Yes, should put SetValue() before SetFromOptions() Best regards. On Fri, Sep 11, 2020 at 2:39 PM Matthew Knepley wrote: > On Fri, Sep 11, 2020 at 4:38 PM Zhuo Chen wrote: > >> Hi Matthew, >> >> I am sorry if I misunderstood. Do you

Re: [petsc-users] How to activate the modified Gram-Schmidt orthogonalization process in Fortran?

2020-09-11 Thread Matthew Knepley
On Fri, Sep 11, 2020 at 4:38 PM Zhuo Chen wrote: > Hi Matthew, > > I am sorry if I misunderstood. Do you mean the modified Gram-Schmidt will > be working for the first time but not for the subsequent times or the > reverse? I have checked the output of a complete loop, and it print out the >

Re: [petsc-users] How to activate the modified Gram-Schmidt orthogonalization process in Fortran?

2020-09-11 Thread Zhuo Chen
Hi Matthew, I am sorry if I misunderstood. Do you mean the modified Gram-Schmidt will be working for the first time but not for the subsequent times or the reverse? I have checked the output of a complete loop, and it print out the same lines, i.e., KSP Object: 4 MPI processes type: gmres

Re: [petsc-users] How to activate the modified Gram-Schmidt orthogonalization process in Fortran?

2020-09-11 Thread Matthew Knepley
On Fri, Sep 11, 2020 at 4:10 PM Zhuo Chen wrote: > Hi Matthew, > > Yes. These four lines are in a do while loop. > The first time through, it will not work :) Thanks, Matt > On Fri, Sep 11, 2020 at 2:07 PM Matthew Knepley wrote: > >> On Fri, Sep 11, 2020 at 3:56 PM Zhuo Chen wrote:

Re: [petsc-users] How to activate the modified Gram-Schmidt orthogonalization process in Fortran?

2020-09-11 Thread Zhuo Chen
Hi Matthew, Yes. These four lines are in a do while loop. On Fri, Sep 11, 2020 at 2:07 PM Matthew Knepley wrote: > On Fri, Sep 11, 2020 at 3:56 PM Zhuo Chen wrote: > >> Hi Matthew, >> >> Yes, if use >> >> call KSPSetType(ksp,KSPGMRES,ierr);CHKERRQ(ierr) >> call

Re: [petsc-users] How to activate the modified Gram-Schmidt orthogonalization process in Fortran?

2020-09-11 Thread Matthew Knepley
On Fri, Sep 11, 2020 at 3:56 PM Zhuo Chen wrote: > Hi Matthew, > > Yes, if use > > call KSPSetType(ksp,KSPGMRES,ierr);CHKERRQ(ierr) > call KSPSetFromOptions(ksp,ierr);CHKERRQ(ierr) > call > PetscOptionsSetValue(PETSC_NULL_OPTIONS,'-ksp_gmres_modifiedgramschmidt','1',ierr);CHKERRQ(ierr) > call >

Re: [petsc-users] How to activate the modified Gram-Schmidt orthogonalization process in Fortran?

2020-09-11 Thread Zhuo Chen
Hi Matthew, Yes, if use call KSPSetType(ksp,KSPGMRES,ierr);CHKERRQ(ierr) call KSPSetFromOptions(ksp,ierr);CHKERRQ(ierr) call PetscOptionsSetValue(PETSC_NULL_OPTIONS,'-ksp_gmres_modifiedgramschmidt','1',ierr);CHKERRQ(ierr) call

Re: [petsc-users] How to activate the modified Gram-Schmidt orthogonalization process in Fortran?

2020-09-11 Thread Matthew Knepley
On Fri, Sep 11, 2020 at 3:05 PM Zhuo Chen wrote: > Hi Hong, > > Thank you very much for the plan. > > Though it may be obvious to many Petsc gurus. I would like to summarize my > solution to activate the modified Gram-Schmidt orthogonalization process in > Fortran now. It may help some new Petsc

Re: [petsc-users] How to activate the modified Gram-Schmidt orthogonalization process in Fortran?

2020-09-11 Thread Zhuo Chen
Hi Hong, Thank you very much for the plan. Though it may be obvious to many Petsc gurus. I would like to summarize my solution to activate the modified Gram-Schmidt orthogonalization process in Fortran now. It may help some new Petsc users. Option 1: append the -ksp_gmres_modifiedgramschmidt at

Re: [petsc-users] How to activate the modified Gram-Schmidt orthogonalization process in Fortran?

2020-09-11 Thread Zhang, Hong via petsc-users
Zhuo, I'll try to get it done after the incoming release. My hands are full with more urgent tasks at moment. I'll let you know after I'm done. Thanks for your patience. Hong From: Zhuo Chen Sent: Thursday, September 10, 2020 8:41 PM To: Zhang, Hong Cc:

Re: [petsc-users] How to activate the modified Gram-Schmidt orthogonalization process in Fortran?

2020-09-11 Thread Klaij, Christiaan
Sure, that was the advise 9 years ago in the ancient thread. It's not a big problem. Chris dr. ir. Christiaan Klaij | Senior Researcher | Research & Development MARIN | T +31 317 49 33 44 | c.kl...@marin.nl | www.marin.nl

Re: [petsc-users] How to activate the modified Gram-Schmidt orthogonalization process in Fortran?

2020-09-11 Thread Zhang, Hong via petsc-users
Sorry, we have not done it. Can you use PetscOptionsSetValue("-ksp_gmres_modifiedgramschmidt", "1") for now? We'll try to add the fortran binding later. Hong From: petsc-users on behalf of Klaij, Christiaan Sent: Friday, September 11, 2020 7:50 AM To:

Re: [petsc-users] How to activate the modified Gram-Schmidt orthogonalization process in Fortran?

2020-09-11 Thread Klaij, Christiaan
Make me feel ancient. Would be nice to have the fortran binding though... Chris > -- > > Message: 1 > Date: Thu, 10 Sep 2020 19:41:30 -0600 > From: Zhuo Chen > To: "Zhang, Hong" > Cc: "petsc-users@mcs.anl.gov" > Subject: Re:

Re: [petsc-users] How to activate the modified Gram-Schmidt orthogonalization process in Fortran?

2020-09-10 Thread Zhuo Chen
Hi Hong, According to that very old thread, KSPGMRESSetOrthogonalization was not implemented in Fortran. I did as you suggested and the compiler will tell me undefined reference to `kspgmressetorthogonalization_' I think I will use the -ksp_gmres_modifiedgramschmidt method. Thank you so much!

Re: [petsc-users] How to activate the modified Gram-Schmidt orthogonalization process in Fortran?

2020-09-10 Thread Barry Smith
The options database option should work also. Are you calling KSPSetFromOptions()? Also -ksp_view should include information about the orthogonalization used. Barry > On Sep 10, 2020, at 8:32 PM, Zhang, Hong via petsc-users > wrote: > > Zhuo, > Call > KSPSetType(ksp,KSPGMRES); >

Re: [petsc-users] How to activate the modified Gram-Schmidt orthogonalization process in Fortran?

2020-09-10 Thread Zhang, Hong via petsc-users
Zhuo, Call KSPSetType(ksp,KSPGMRES); KSPGMRESSetOrthogonalization(ksp,KSPGMRESModifiedGramSchmidtOrthogonalization); Hong From: Zhuo Chen Sent: Thursday, September 10, 2020 8:17 PM To: Zhang, Hong Cc: petsc-users@mcs.anl.gov Subject: Re: [petsc-users] How to

Re: [petsc-users] How to activate the modified Gram-Schmidt orthogonalization process in Fortran?

2020-09-10 Thread Zhuo Chen
Hi Hong, Thank you very much for your help. It seems that if I simply append -ksp_gmres_modifiedgramschmidt the warning goes away. However KSPGMRESSetOrthogonalization(ksp,KSPGMRESModifiedGramSchmidtOrthogonalization,ierr) has another issue. Error: Symbol

Re: [petsc-users] How to activate the modified Gram-Schmidt orthogonalization process in Fortran?

2020-09-10 Thread Zhang, Hong via petsc-users
Zhuo, Run your code with option '-ksp_gmres_modifiedgramschmidt'. For example, petsc/src/ksp/ksp/tutorials mpiexec -n 2 ./ex2 -ksp_view -ksp_gmres_modifiedgramschmidt KSP Object: 2 MPI processes type: gmres restart=30, using Modified Gram-Schmidt Orthogonalization happy breakdown

[petsc-users] How to activate the modified Gram-Schmidt orthogonalization process in Fortran?

2020-09-10 Thread Zhuo Chen
Dear Petsc users, I found an ancient thread discussing this problem. https://lists.mcs.anl.gov/pipermail/petsc-users/2011-October/010607.html However, when I add call KSPSetType(ksp,KSPGMRES,ierr);CHKERRQ(ierr) call