[petsc-users] Report Bug TaoALMM class

Barry Smith bsmith at petsc.dev
Fri Oct 28 15:24:44 CDT 2022


  Stephan,

     Thanks for your detailed report. 

     Do you have a reproducing example? 

     I am having trouble following the logic you indicate below.  

    It is copying the P into auglag->P. Is auglag->P the "the current solution" you are referring to? 

    Is it because of the line PetscCall(TaoSetSolution(auglag->subsolver, auglag->P))? So I am assuming that you mean the current solution of the auglag->subsolver Tao?

    This means that TaoALMMSubsolverObjective_Private() always sets the subsolver Tao current solution to the input P. Are you saying this is flawed logic in the implementation of the entire ALMM solver? 

    Since the auglag->P gets overwritten for every TaoALMMSubsolverObjective_Private()  with the new P passed in I don't see where ((xk + dxk) + alpha * dxk) would occur. Would it first have xk + dxk passed in for P and then the next time have xk + alpha * dxk passed in?

  Barry

PetscErrorCode TaoALMMSubsolverObjective_Private(Tao tao, Vec P, PetscReal *Lval, void *ctx)
{
  TAO_ALMM *auglag = (TAO_ALMM *)ctx;

  PetscFunctionBegin;
  PetscCall(VecCopy(P, auglag->P));
  PetscCall((*auglag->sub_obj)(auglag->parent));
  *Lval = auglag->Lval;
  PetscFunctionReturn(0);
}



> On Oct 28, 2022, at 4:27 AM, Stephan Köhler <stephan.koehler at math.tu-freiberg.de> wrote:
> 
> Dear PETSc/Tao team,
> 
> it seems to be that there is a bug in the TaoALMM class:
> 
> In the methods TaoALMMSubsolverObjective_Private and TaoALMMSubsolverObjectiveAndGradient_Private the vector where the function value for the augmented Lagrangian is evaluate
> is copied into the current solution, see, e.g., https://petsc.org/release/src/tao/constrained/impls/almm/almm.c.html line 672 or 682.  This causes subsolver routine to not converge if the line search for the subsolver rejects the step length 1. for some
> update.  In detail:
> 
> Suppose the current iterate is xk and the current update is dxk. The line search evaluates the augmented Lagrangian now at (xk + dxk).  This causes that the value (xk + dxk) is copied in the current solution.  If the point (xk + dxk) is rejected, the line search should
> try the point (xk + alpha * dxk), where alpha < 1.  But due to the copying, what happens is that the point ((xk + dxk) + alpha * dxk) is evaluated, see, e.g., https://petsc.org/release/src/tao/linesearch/impls/armijo/armijo.c.html line 191.
> 
> Best regards
> Stephan Köhler
> 
> -- 
> Stephan Köhler
> TU Bergakademie Freiberg
> Institut für numerische Mathematik und Optimierung
> 
> Akademiestraße 6
> 09599 Freiberg
> Gebäudeteil Mittelbau, Zimmer 2.07
> 
> Telefon: +49 (0)3731 39-3173 (Büro)
> 
> <OpenPGP_0xC9BF2C20DFE9F713.asc>



More information about the petsc-users mailing list