I don't think the change was "necessary" for bt; I made the change to have more "robustness" for a sloppily provided maximum step length. That is for people who did not understand their problem's length scales. I was too quick to make the change without more thought. I don't have any underlying mathematical principles to rely on for handling appropriate maximum and minimum lengths, thus it has always been ad hoc.
Barry > On Jun 20, 2023, at 3:21 PM, Nabil Abboud <nabil.abb...@ansys.com> wrote: > > Hi Barry, > > I just wanted to follow up on your previous email. Regarding the change that > was made to the maxstep for the linesearch in petsc version 3.19.1, was this > change necessary for the bt line search to work properly? The reason I am > asking is because if so, then if we revert that part of the code back to how > it was in petsc version 3.19.0 does it mean that the bt line search won't > function properly? > > Thank you. > Best, > Nabil > From: Barry Smith <bsm...@petsc.dev <mailto:bsm...@petsc.dev>> > Sent: Tuesday, June 20, 2023 12:55 PM > To: Nabil Abboud <nabil.abb...@ansys.com <mailto:nabil.abb...@ansys.com>> > Cc: petsc-dev@mcs.anl.gov <mailto:petsc-dev@mcs.anl.gov> > <petsc-dev@mcs.anl.gov <mailto:petsc-dev@mcs.anl.gov>> > Subject: Re: [petsc-dev] Inquiry about a change in petsc version 3.19.1 > > [External Sender] > > Looks like a fatally flawed change I should never have made. I have an MR > to revert it https://gitlab.com/petsc/petsc/-/merge_requests/6620 Should get > into release and main by tommorow. > > Barry > > >> On Jun 19, 2023, at 4:37 PM, Barry Smith <bsm...@petsc.dev >> <mailto:bsm...@petsc.dev>> wrote: >> >> >> Sorry about this, we'll take a look and get back to you. >> >> >> >>> On Jun 19, 2023, at 4:05 PM, Nabil Abboud via petsc-dev >>> <petsc-dev@mcs.anl.gov <mailto:petsc-dev@mcs.anl.gov>> wrote: >>> >>> Dear all, >>> >>> We were trying to update the petsc version we use in our code to the >>> version 3.19.1 when we noticed that some of the unit tests in our code >>> started failing. The reason for the failure seems to be due to a change in >>> the linesearch logic of petsc version 3.19.1. In particular, the >>> implementation of the function SNESLineSearchGetTolerances was modified >>> such that maxstep is now scaled with fnorm as shown in the following link >>> https://gitlab.com/petsc/petsc/-/blob/main/src/snes/linesearch/interface/linesearch.c#L1097 >>> This change seems to be inconsistent with the way maxstep is being used >>> later on to compute a step size using the l2 line search algorithm, for >>> instance, check the following code >>> https://gitlab.com/petsc/petsc/-/blob/main/src/snes/linesearch/impls/l2/linesearchl2.c#L119 >>> where maxstep is compared to lambda_update and where maxstep is scaled by >>> fnorm whereas lambda_update seems to be a scalar of a different order as >>> computed here >>> https://gitlab.com/petsc/petsc/-/blob/main/src/snes/linesearch/impls/l2/linesearchl2.c#L111 >>> . >>> The way this change is reflected in our code is that we were trying to >>> enforce a range for the step size provided by the l2 line search between >>> 0.1 and 1 and now with the new changes in petsc version 3.19.1 the upper >>> limit seems not to hold anymore and we are seeing step sizes larger than 1. >>> >>> Thank you in advance for your help. >>> Best regards, >>> Nabil