Re: [petsc-users] VecSet and VecAssemblyBegin

2025-04-26 Thread Matthew Knepley
On Sat, Apr 26, 2025 at 1:46 PM Barry Smith wrote: > > The guards are supposed to be universal, not one-offs that are put into > specific locations. How come no errors with debug mode are detected in this > situation?] > Hmm, VecSet() has PetscCall(VecSetErrorIfLocked(x, 1)); which shoul

Re: [petsc-users] VecSet and VecAssemblyBegin

2025-04-26 Thread Barry Smith
The guards are supposed to be universal, not one-offs that are put into specific locations. How come no errors with debug mode are detected in this situation? Barry > On Apr 26, 2025, at 1:09 PM, Matthew Knepley wrote: > > Junchao, should we put guards in VecSet() and LocalToGlobal() fo

Re: [petsc-users] VecSet and VecAssemblyBegin

2025-04-26 Thread Matthew Knepley
Junchao, should we put guards in VecSet() and LocalToGlobal() for the array lock? Thanks, Matt On Sat, Apr 26, 2025 at 11:50 AM Junchao Zhang wrote: > Yes, that is correct. > > --Junchao Zhang > > > On Sat, Apr 26, 2025 at 10:35 AM Derek Teaney > wrote: > >> Ok -- got it -- thanks so j

Re: [petsc-users] VecSet and VecAssemblyBegin

2025-04-26 Thread Junchao Zhang
Yes, that is correct. --Junchao Zhang On Sat, Apr 26, 2025 at 10:35 AM Derek Teaney wrote: > Ok -- got it -- thanks so just do the RestoreArray before the final step, > e.g. > > Loop over cases > VecSet(dn_local, 0.) > GetArray(dn_local, &dn) // RIGHT > Fill up dn > Re

Re: [petsc-users] problem with nested logging

2025-04-26 Thread Junchao Zhang
Toby (Cc'ed) might know it. Or could you provide an example? --Junchao Zhang On Fri, Apr 25, 2025 at 3:31 AM Klaij, Christiaan via petsc-users < petsc-users@mcs.anl.gov> wrote: > We recently upgraded from 3.19.4 to 3.22.4 but face the problem below with > the nested logging. Any ideas? > > Chr

Re: [petsc-users] VecSet and VecAssemblyBegin

2025-04-26 Thread Junchao Zhang
On Sat, Apr 26, 2025 at 8:27 AM Derek Teaney via petsc-users < petsc-users@mcs.anl.gov> wrote: > Thanks Barry -- this solved the issue. > > "probably will be fine" was fine with 3.17 and maybe 3.19, but definitely > not fine with 3.20. > > For others the faulty logic is: > > GetArray(dn_local, &d

Re: [petsc-users] VecSet and VecAssemblyBegin

2025-04-26 Thread Derek Teaney via petsc-users
Thanks Barry -- this solved the issue. "probably will be fine" was fine with 3.17 and maybe 3.19, but definitely not fine with 3.20. For others the faulty logic is: GetArray(dn_local, &dn) //WRONG Loop over cases VecSet(dn_local, 0.) Fill up dn LocalToGlobal RestoreArray Whe