StructJuMP / StructJuMP.jl

A block-structured optimization framework for JuMP
Other
54 stars 19 forks source link

Updates to JuMP 0.21 #77

Closed odow closed 4 years ago

odow commented 4 years ago

This is my first time diving into StructJuMP. I have a number of questions:

blegat commented 4 years ago

NLP works in the latest tagged version with JuMP v0.18 and MPB but it has not been implemented on the master branch for JuMP v0.19 and MOI.

The goal of StructJuMP is to extend JuMP/MOI for structured models. Three solvers could be used:

The key feature that is needed is that models can be created in parallel in a distributed environement. PIPS will for instance use one computer for each child and IIUC, with the currently tagged version, the models of the childs are also created in different computers. We can assume for instance that the complete model would not fit in the RAM of one single computer but we should still be able to do modeling with JuMP macros + solving.

Having JuMP models instead of StructuredModel would not work as JuMP models cannot contain variables from another models. It used to be possible in JuMP v0.18 as the constraints were not passed directly to the solver. This is kind of what is done with StructuredModel now, we keep the constraint in JuMP form. I discussed with @michel2323 on how we could make PIPS work with the new StructJuMP at JuliaCon. The plan was to: 1) Create https://github.com/michel2323/PIPS.jl that wrap PIPS and add pass MOI tests. 2) Define a MOI variable attribute VariableNode and a MOI constraint attribute ConstraintNode in StructJuMP. StructJuMP would then give to the PIPS instance of child i both the master variables/constraints and the child i variables/constraints but will set VariableNode and ConstraintNode to each variables and constraints so that PIPS can distinguish between the two. 4) Add support for NLP. 3) The current benders code could be rewritten as an MOI solver using this MOI API (that could be easier if ParameterJuMP was written as an MOI layer). This would allow to test the MOI API in this package with the benders code.

michel2323 commented 4 years ago

I plan on working on this again as need StructJuMP for DSP and Ipopt with NLP support. The first goal would be to get NLP support back in.

kibaekkim commented 4 years ago

I confirm that DSP.jl (using StructJuMP.jl#kibaekkim-patch-1) is working with this PR too.

kibaekkim commented 4 years ago

I found that our travis test runs on Julia 1.0 and 1.1 only. The test fails on Julia 1.4. The reason seems related to GLPK artifact..

ERROR: LoadError: LoadError: InitError: could not load library "/Users/kibaekkim/.julia/artifacts/3677b4b693751024a0923d9e7c6d56da89f15b8e/lib/libgmpxx.4.dylib"
dlopen(/Users/kibaekkim/.julia/artifacts/3677b4b693751024a0923d9e7c6d56da89f15b8e/lib/libgmpxx.4.dylib, 1): Library not loaded: @rpath/libgmp.10.dylib
  Referenced from: /Users/kibaekkim/.julia/artifacts/3677b4b693751024a0923d9e7c6d56da89f15b8e/lib/libgmpxx.4.dylib
  Reason: Incompatible library version: libgmpxx.4.dylib requires version 15.0.0 or later, but libgmp.dylib provides version 14.0.0
kibaekkim commented 4 years ago

And I confirm that the error comes from GLPK.jl, for which the test fails. https://github.com/JuliaOpt/GLPK.jl/issues/140

kibaekkim commented 4 years ago

Test passed on linux with julia v1.4.

blegat commented 4 years ago

Thanks for checking. The GLPK error seems unrelated so I merge