Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One-line output for print_level=1 #86

Open
PierreMartinon opened this issue May 2, 2024 · 3 comments
Open

One-line output for print_level=1 #86

PierreMartinon opened this issue May 2, 2024 · 3 comments
Assignees

Comments

@PierreMartinon
Copy link
Member

PierreMartinon commented May 2, 2024

Display some basic information:
Satus - Objective - Constraints - iterations ?

@joseph-gergaud
Copy link
Member

What do you mean exactly ?

@PierreMartinon
Copy link
Member Author

PierreMartinon commented Jun 20, 2024

Hi @joseph-gergaud !

I would like ipopt to display only one line of output, typically the success / failure and maybe the objective.

Currently we have this

julia> solve(ocp,print_level=0);

julia> solve(ocp,print_level=1);

julia> solve(ocp,print_level=2);

julia> solve(ocp,print_level=3);
Total number of variables............................:      404
                     variables with only lower bounds:      202
                variables with lower and upper bounds:        0
                     variables with only upper bounds:        0
Total number of equality constraints.................:      203
Total number of inequality constraints...............:        0
        inequality constraints with only lower bounds:        0
   inequality constraints with lower and upper bounds:        0
        inequality constraints with only upper bounds:        0


Number of Iterations....: 9

                                   (scaled)                 (unscaled)
Objective...............:   3.1303695485806754e-01    3.1303695485806754e-01
Dual infeasibility......:   4.4408920985006262e-16    4.4408920985006262e-16
Constraint violation....:   2.8779752019036930e-12    2.8779752019036930e-12
Variable bound violation:   9.7032585134461507e-09    9.7032585134461507e-09
Complementarity.........:   1.5503759072192753e-11    1.5503759072192753e-11
Overall NLP error.......:   1.5503759072192753e-11    1.5503759072192753e-11


Number of objective function evaluations             = 10
Number of objective gradient evaluations             = 10
Number of equality constraint evaluations            = 10
Number of inequality constraint evaluations          = 0
Number of equality constraint Jacobian evaluations   = 10
Number of inequality constraint Jacobian evaluations = 0
Number of Lagrangian Hessian evaluations             = 9
Total seconds in IPOPT                               = 0.015

EXIT: Optimal Solution Found.

For whatever reason print_level=1,2 gives no output, same as print_level=0. I would like for instance print_level=1 to print only the last line.

@PierreMartinon
Copy link
Member Author

I'll try to print the internal_msg recovered by NLPModelsIpopt for print_level=1.
For print_level=2 we could add the objective, contraints violation and iterations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants