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

set_optimizer_attribute() issue #95

Closed
kocvara opened this issue Mar 29, 2022 · 6 comments
Closed

set_optimizer_attribute() issue #95

kocvara opened this issue Mar 29, 2022 · 6 comments

Comments

@kocvara
Copy link

kocvara commented Mar 29, 2022

Julia 1.7.1
The following piece of code

model = read_from_file("../../../sdplib/theta1.dat-s")
set_optimizer(model, Mosek.Optimizer)
set_optimizer_attribute(model,"MSK_IPAR_INTPNT_SOLVE_FORM", MosekTools.MSK_SOLVE_DUAL)

gives error message

ERROR: MethodError: no method matching map_indices(::MathOptInterface.Utilities.var"#7#8"{MathOptInterface.Utilities.IndexMap}, ::Mosek.Solveform)

This works:

model = Model(with_optimizer(Mosek.Optimizer,  MSK_IPAR_INTPNT_SOLVE_FORM  = MosekTools.MSK_SOLVE_DUAL));

but then I don't know how to read the SDPA file into the existing model.

@blegat blegat self-assigned this Mar 29, 2022
@blegat
Copy link
Member

blegat commented Mar 29, 2022

Which version of MathOptInterface are you using ?
This should have been fixed in jump-dev/MathOptInterface.jl#1672

@kocvara
Copy link
Author

kocvara commented Mar 29, 2022

[b8f27783] MathOptInterface v0.9.22

I updated all and the problem is still there

@blegat
Copy link
Member

blegat commented Mar 29, 2022

julia> using JuMP

julia> model = read_from_file("theta1.dat-s")
A JuMP Model
Minimization problem with:
Variables: 104
Objective function type: AffExpr
`Vector{AffExpr}`-in-`MathOptInterface.PositiveSemidefiniteConeTriangle`: 1 constraint
Model mode: AUTOMATIC
CachingOptimizer state: NO_OPTIMIZER
Solver name: No optimizer attached.

julia> set_optimizer(model, Mosek.Optimizer)

julia> set_optimizer_attribute(model,"MSK_IPAR_INTPNT_SOLVE_FORM", MosekTools.MSK_SOLVE_DUAL)

(MosekTools) pkg> st
     Project MosekTools v0.12.1
      Status `~/.julia/dev/MosekTools/Project.toml`
  [4076af6c] JuMP v1.0.0
  [b8f27783] MathOptInterface v1.1.1
  [6405355b] Mosek v1.2.2
  [de0858da] Printf

I cannot reproduce with the latest version.
Have you restarted Julia after updating ?

@kocvara
Copy link
Author

kocvara commented Mar 29, 2022

UPDATE
I removed all my packages and installed the necessary ones from new. Now I have the same versions as you and the code works. Due to some older package, the other packages wouldn't update to the latest version.

Thanks for your help!
Michal

ORIGINAL
I have. But I see that all your versions are newer than mine (you being a developer?). This might be a silly problem on my side, sorry if it is, I am just using

(@v1.7) pkg> update

and get

[4076af6c] JuMP v0.21.4
[b8f27783] MathOptInterface v0.9.22
[1ec41992] MosekTools v0.9.4

@blegat
Copy link
Member

blegat commented Mar 29, 2022

There are still a few packages not supporting MathOptInterface v0.10 so one of them might have you blocked behind.
We just released MathOptInterface v1.0 and JuMP v1.0 so hopefully once all packages have gotten up to speed, this won't happen too much in the future. The major ones (including Penopt.jl of course!) have already been updated see jump-dev/JuMP.jl#2564

@blegat blegat removed their assignment Mar 30, 2022
@odow
Copy link
Member

odow commented Aug 18, 2022

Closing because this seems fixed.

@odow odow closed this as completed Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants