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

Problem with MOI_wrapper #44

Closed
guilhermebodin opened this issue Sep 2, 2019 · 2 comments
Closed

Problem with MOI_wrapper #44

guilhermebodin opened this issue Sep 2, 2019 · 2 comments

Comments

@guilhermebodin
Copy link

This works in SCS but does not in CSDP

# Does not work
model = Model(with_optimizer(CSDP.Optimizer))
@variable(model, x)
@constraint(model, [4x x; x 4x] - ones(2, 2) in PSDCone())
@objective(model, Min, x)
optimize!(model)

and gives the error

ERROR: Using bridged variable in `SingleVariable` function.
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] bridged_function at /home/guilhermebodin/.julia/packages/MathOptInterface/016Ol/src/Bridges/bridge_optimizer.jl:950 [inlined]
 [3] set(::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{CSDP.Optimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, ::MathOptInterface.ObjectiveFunction{MathOptInterface.SingleVariable}, ::MathOptInterface.SingleVariable) at /home/guilhermebodin/.julia/packages/MathOptInterface/016Ol/src/Bridges/bridge_optimizer.jl:450
 [4] _pass_attributes(::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{CSDP.Optimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, ::MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}, ::Bool, ::MathOptInterface.Utilities.IndexMap, ::Array{MathOptInterface.AbstractModelAttribute,1}, ::Tuple{}, ::Tuple{}, ::Tuple{}, ::typeof(MathOptInterface.set)) at /home/guilhermebodin/.julia/packages/MathOptInterface/016Ol/src/Utilities/copy.jl:148
 [5] pass_attributes at /home/guilhermebodin/.julia/packages/MathOptInterface/016Ol/src/Utilities/copy.jl:112 [inlined]
 [6] pass_attributes at /home/guilhermebodin/.julia/packages/MathOptInterface/016Ol/src/Utilities/copy.jl:111 [inlined]
 [7] default_copy_to(::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{CSDP.Optimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, ::MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}, ::Bool) at /home/guilhermebodin/.julia/packages/MathOptInterface/016Ol/src/Utilities/copy.jl:337
 [8] #automatic_copy_to#97 at /home/guilhermebodin/.julia/packages/MathOptInterface/016Ol/src/Utilities/copy.jl:15 [inlined]
 [9] #automatic_copy_to at ./none:0 [inlined]
 [10] #copy_to#1 at /home/guilhermebodin/.julia/packages/MathOptInterface/016Ol/src/Bridges/bridge_optimizer.jl:167 [inlined]
 [11] (::getfield(MathOptInterface, Symbol("#kw##copy_to")))(::NamedTuple{(:copy_names,),Tuple{Bool}}, ::typeof(MathOptInterface.copy_to), ::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{CSDP.Optimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, ::MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}) at ./none:0
 [12] attach_optimizer(::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}) at /home/guilhermebodin/.julia/packages/MathOptInterface/016Ol/src/Utilities/cachingoptimizer.jl:138
 [13] optimize!(::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}) at /home/guilhermebodin/.julia/packages/MathOptInterface/016Ol/src/Utilities/cachingoptimizer.jl:174
 [14] #optimize!#78(::Bool, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Model, ::Nothing) at /home/guilhermebodin/.julia/packages/JuMP/iGamg/src/optimizer_interface.jl:141
 [15] optimize! at /home/guilhermebodin/.julia/packages/JuMP/iGamg/src/optimizer_interface.jl:111 [inlined] (repeats 2 times)
 [16] top-level scope at none:0
# Work
model = Model(with_optimizer(SCS.Optimizer))
@variable(model, x)
@constraint(model, [4x x; x 4x] - ones(2, 2) in PSDCone())
@objective(model, Min, x)
optimize!(model)

This is the Project.toml I am testing against

(TesteCSDP) pkg> st
    Status `~/Documents/TesteCSDP/Project.toml`
  [0a46da34] CSDP v0.5.1
  [4076af6c] JuMP v0.20.0
  [c946c3f1] SCS v0.6.0

(TesteCSDP) pkg> st --manifest
    Status `~/Documents/TesteCSDP/Manifest.toml`
  [6e4b80f9] BenchmarkTools v0.4.2
  [9e28174c] BinDeps v0.8.10
  [b99e7846] BinaryProvider v0.5.6
  [0a46da34] CSDP v0.5.1
  [49dc2e85] Calculus v0.5.0
  [bbf7d656] CommonSubexpressions v0.2.0
  [34da2185] Compat v2.1.0
  [864edb3b] DataStructures v0.17.0
  [163ba53b] DiffResults v0.0.4
  [b552c78f] DiffRules v0.0.10
  [f6369f11] ForwardDiff v0.10.3
  [92fee26a] GZip v0.5.0
  [c27321d9] Glob v1.2.0
  [682c06a0] JSON v0.21.0
  [4076af6c] JuMP v0.20.0
  [b8f27783] MathOptInterface v0.9.1
  [fdba3010] MathProgBase v0.7.7
  [77ba4419] NaNMath v0.3.2
  [bac558e1] OrderedCollections v1.1.0
  [69de0a69] Parsers v0.3.7
  [c946c3f1] SCS v0.6.0
  [169818f4] SemidefiniteModels v0.1.1
  [276daf66] SpecialFunctions v0.8.0
  [90137ffa] StaticArrays v0.11.0
  [30578b45] URIParser v0.4.0
  [2a0f44e3] Base64 
  [ade2ca70] Dates 
  [8bb1440f] DelimitedFiles 
  [8ba89e20] Distributed 
  [b77e0a4c] InteractiveUtils 
  [76f85450] LibGit2 
  [8f399da3] Libdl 
  [37e2e46d] LinearAlgebra 
  [56ddb016] Logging 
  [d6f4376e] Markdown 
  [a63ad114] Mmap 
  [44cfe95a] Pkg 
  [de0858da] Printf 
  [3fa0cd96] REPL 
  [9a3f8284] Random 
  [ea8e919c] SHA 
  [9e88b42a] Serialization 
  [1a1011a3] SharedArrays 
  [6462fe0b] Sockets 
  [2f01184e] SparseArrays 
  [10745b16] Statistics 
  [8dfed614] Test 
  [cf7118a7] UUIDs 
  [4ec0a83e] Unicode
@blegat
Copy link
Member

blegat commented Sep 3, 2019

We need jump-dev/MathOptInterface.jl#789 (comment), it should be fixed in MOI v0.9.2. For now, use 1x in the objective as a workaround

@guilhermebodin
Copy link
Author

It is working now

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

2 participants