Skip to content

NLPModelsIpopt options not registering when rebuilding backend #26

@wenwen0231

Description

@wenwen0231

I'm encountering an issue where previously set solver options do not apply to rebuilt backends.
Here's an MRE where both set_silent and print_timing_statistics did not apply in the second solve:

using InfiniteOpt, InfiniteExaModels, NLPModelsIpopt, Interpolations

m = InfiniteModel(ExaTranscriptionBackend(NLPModelsIpopt.IpoptSolver))
@infinite_parameter(m, t in [0, 1], num_supports = 5)
@infinite_parameter(m, x in [-1, 1], num_supports = 5)
@variable(m, y >= 0, Infinite(t, x), start = 1.0)
@finite_parameter(m, z == 10)
@objective(m, Min, ∫(∫(y^2, t) + 2z, x))
@constraint(m, y + z <= 42 + t)
set_silent(m)
set_optimizer_attribute(m, "print_timing_statistics", "yes")
optimize!(m)
set_start_values(m)
optimize!(m)

and the REPL output:

This is Ipopt version 3.14.19, running with linear solver MUMPS 5.8.1.

Number of nonzeros in equality constraint Jacobian...:        0
Number of nonzeros in inequality constraint Jacobian.:       25
Number of nonzeros in Lagrangian Hessian.............:       25

Total number of variables............................:       25
                     variables with only lower bounds:       25
                variables with lower and upper bounds:        0
                     variables with only upper bounds:        0
Total number of equality constraints.................:        0
Total number of inequality constraints...............:       25
        inequality constraints with only lower bounds:        0
   inequality constraints with lower and upper bounds:        0
        inequality constraints with only upper bounds:       25

iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
   0  4.0000200e+01 0.00e+00 1.25e-03  -1.0 0.00e+00    -  0.00e+00 0.00e+00   0
   1  4.0024081e+01 0.00e+00 3.94e-03  -1.0 9.99e-02    -  9.96e-01 1.00e+00f  1
   2  4.0529845e+01 0.00e+00 2.00e-07  -1.7 8.08e-01    -  1.00e+00 1.00e+00f  1
   3  4.0151809e+01 0.00e+00 2.83e-08  -2.5 4.32e-01    -  1.00e+00 1.00e+00f  1
   4  4.0038967e+01 0.00e+00 1.50e-09  -3.8 2.40e-01    -  1.00e+00 1.00e+00f  1
   5  4.0010702e+01 0.00e+00 1.50e-09  -3.8 1.18e-01    -  1.00e+00 1.00e+00f  1
   6  4.0002688e+01 0.00e+00 1.84e-11  -5.7 6.38e-02    -  1.00e+00 1.00e+00f  1
   7  4.0000684e+01 0.00e+00 1.84e-11  -5.7 3.18e-02    -  1.00e+00 1.00e+00f  1
   8  4.0000183e+01 0.00e+00 1.84e-11  -5.7 1.57e-02    -  1.00e+00 1.00e+00f  1
   9  4.0000046e+01 0.00e+00 2.51e-14  -8.6 8.29e-03    -  1.00e+00 1.00e+00f  1
iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
  10  4.0000011e+01 0.00e+00 2.51e-14  -8.6 4.14e-03    -  1.00e+00 1.00e+00f  1
  11  4.0000003e+01 0.00e+00 2.51e-14  -8.6 2.07e-03    -  1.00e+00 1.00e+00f  1
  12  4.0000001e+01 0.00e+00 2.51e-14  -8.6 1.03e-03    -  1.00e+00 1.00e+00f  1
  13  4.0000000e+01 0.00e+00 2.51e-14  -8.6 5.05e-04    -  1.00e+00 1.00e+00f  1
  14  4.0000000e+01 0.00e+00 9.09e-15  -9.0 2.58e-04    -  1.00e+00 1.00e+00h  1

Number of Iterations....: 14

                                   (scaled)                 (unscaled)
Objective...............:   4.0000000055738361e+01    4.0000000055738361e+01
Dual infeasibility......:   9.0909132435465501e-15    9.0909132435465501e-15
Constraint violation....:   0.0000000000000000e+00    0.0000000000000000e+00
Variable bound violation:   0.0000000000000000e+00    0.0000000000000000e+00
Complementarity.........:   5.0825507409666755e-09    5.0825507409666755e-09
Overall NLP error.......:   5.0825507409666755e-09    5.0825507409666755e-09


Number of objective function evaluations             = 15
Number of objective gradient evaluations             = 15
Number of equality constraint evaluations            = 0
Number of inequality constraint evaluations          = 15
Number of equality constraint Jacobian evaluations   = 0
Number of inequality constraint Jacobian evaluations = 15
Number of Lagrangian Hessian evaluations             = 14
Total seconds in IPOPT                               = 0.129

EXIT: Optimal Solution Found.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions