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

No console information printing #967

Closed
SanPen opened this issue Oct 9, 2022 · 5 comments
Closed

No console information printing #967

SanPen opened this issue Oct 9, 2022 · 5 comments

Comments

@SanPen
Copy link

SanPen commented Oct 9, 2022

Hi,

I'm trying to avoid Highs console logs but without much success.

I'm trying highs.setOptionValue("log_to_console", false); and highs.setOptionValue("log_to_console", 0);
None seems to work for me.

What would be the correct way to mute 100% of the console outputs?

As a side note, enums are far better than strings for software options. With an enum, I wouldn't have to ask this question.

Thanks

@jajhall
Copy link
Sponsor Member

jajhall commented Oct 9, 2022

Strange: I've just used this successfully myself.

What return code do you get from Highs::setOptionValue?

Highs::setOptionValue("output_flag", false); will switch off all logging, but maybe you still want it in a file

We use strings rather than enums to simplify the C API

@SanPen
Copy link
Author

SanPen commented Oct 9, 2022

Hi, What version are you using? I am on the 1.2.2 release.

The return value is when I set log_to_console is HighsStatus::kOk.

However, setting output_flag to false does the trick.

What would be the expected behaviour of setting log_to_console ?

@jajhall
Copy link
Sponsor Member

jajhall commented Oct 9, 2022

I'm on master, but I'm sure that the log_to_console use hasn't changed recently. Setting it to false should mean that you only get logging to the file.

I'll see whether I can reproduce what you observe.

@odow
Copy link
Collaborator

odow commented Dec 19, 2022

I can reproduce this when the solver is set to ipm:

shell> cat options
log_to_console=false

julia> HiGHS_jll.highs() do exe
           run(`$(exe) --options_file=options --solver=ipm model.lp`)
       end;
Input
    Number of variables:                                2
    Number of free variables:                           0
    Number of constraints:                              2
    Number of equality constraints:                     0
    Number of matrix entries:                           4
    Matrix range:                                       [6e+00, 1e+01]
    RHS range:                                          [1e+02, 1e+02]
    Objective range:                                    [1e+01, 2e+01]
    Bounds range:                                       [3e+00, 3e+00]
Preprocessing
    Dualized model:                                     no
    Number of dense columns:                            0
    Range of scaling factors:                           [5.00e-01, 1.00e+00]
IPX version 1.0
Interior Point Solve
 Iter     P.res    D.res            P.obj           D.obj        mu     Time
   0   8.85e+00 2.66e+00   2.03715741e+02  1.90309850e+02  3.67e+01       0s
   1   8.85e-06 2.66e-06   2.15808217e+02  1.93588563e+02  4.44e+00       0s
   2   7.84e-07 5.20e-07   2.05317615e+02  2.02113669e+02  6.41e-01       0s
   3   7.85e-13 4.53e-08   2.05209034e+02  2.04938729e+02  5.41e-02       0s
   4   6.58e-15 4.53e-14   2.05000287e+02  2.04999555e+02  1.46e-04       0s
   5*  6.49e-15 1.78e-15   2.05000000e+02  2.05000000e+02  5.76e-10       0s
 Constructing starting basis...
Running crossover as requested
    Primal residual before push phase:                  8.01e-10
    Dual residual before push phase:                    1.03e-10
    Number of dual pushes required:                     0
    Number of primal pushes required:                   0
Summary
    Runtime:                                            0.00s
    Status interior point solve:                        optimal
    Status crossover:                                   optimal
    objective value:                                    2.05000000e+02
    interior solution primal residual (abs/rel):        1.42e-14 / 1.17e-16
    interior solution dual residual (abs/rel):          1.78e-15 / 8.46e-17
    interior solution objective gap (abs/rel):          2.88e-09 / 1.40e-11
    basic solution primal infeasibility:                0.00e+00
    basic solution dual infeasibility:                  0.00e+00

julia> HiGHS_jll.highs() do exe
           run(`$(exe) --options_file=options --solver=choose model.lp`)
       end;

I'll take a deeper look.

@jajhall
Copy link
Sponsor Member

jajhall commented Jan 23, 2023

Logging by the IPM solver is not done the same way as it is for the rest of HiGHS, so we can't get the same level of logging control within the IPM solver without major re-writing. At the moment all that's possible within the IPM solver is logging to console, or no logging at all.

@jajhall jajhall closed this as completed Jan 23, 2023
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

3 participants