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

WIP: Add a silent option to environment constructor #456

Closed
wants to merge 2 commits into from

Conversation

simonbowly
Copy link
Collaborator

Possible fix for the stray output you are seeing with 9.5 as noted in #437

  1. Printing the license owners's email address: this can only be silenced by creating an empty environment, setting outputflag to zero, then starting the environment.
  2. Stray printing of NonConvex parameters. This would also be silenced by this strategy, however setting OutputFlag first should have also achieved this. Is there something different done by full_bridge_optimizer that might be interfering with the Silent setting? It seems to be only these tests which print parameters.

Copy link
Member

@odow odow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI failed because you pushed to your simonbowly fork. If you want to run the CI, you can push to the jump-dev remote:

git add remote jump-dev https://github.com/jump-dev/Gurobi.jl.git
git push -u jump-dev silent-env

@@ -97,10 +97,15 @@ mutable struct Env
finalize_called::Bool
attached_models::Int

function Env()
function Env(::MOI.Silent, flag::Bool)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just Env(; output_flag::Int = 1)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured you might want alignment with ::Silent for parameter settings, but sure, this makes more sense in a constructor.

@odow
Copy link
Member

odow commented Feb 17, 2022

Ah, I may have found the issue:

# Reset the parameters in this new environment
for (name, value) in model.params
MOI.set(model, MOI.RawOptimizerAttribute(name), value)
end
if model.silent
MOI.set(model, MOI.Silent(), true)
end

Looks like we set silent after we change other parameters 😥

@simonbowly
Copy link
Collaborator Author

Ah, nice one! And that's called in every constructor?

@odow
Copy link
Member

odow commented Feb 17, 2022

If you create a new Optimizer, or call empty!, yes. Let's just switch the two statements.

@simonbowly
Copy link
Collaborator Author

I still get a couple of outputs when running the tests with that change. Are there a few Silent=False settings hanging about?

Set parameter OutputFlag to value 1
Set parameter OutputFlag to value 1
Set parameter NonConvex to value 2
Set parameter DualReductions to value 0
Set parameter InfUnbdInfo to value 1
Set parameter QCPDual to value 1

In MOI.empty(), set outputflag=0 before any other parameter
changes are made.
Set output_flag=0 for all environments used in the tests
@simonbowly
Copy link
Collaborator Author

CI test run for just the parameter ordering change is here - https://github.com/simonbowly/Gurobi.jl/runs/5240766098?check_suite_focus=true

This cleans up everything except the licensing messages, second commit is needed to do that.

@odow
Copy link
Member

odow commented Feb 18, 2022

Can you push to the jump-dev remote so that our CI runs? You can open a new PR if that's easiest.

@simonbowly simonbowly closed this Feb 18, 2022
@simonbowly simonbowly mentioned this pull request Feb 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants