JuMP & warmstart

I’m trying to start SCS with a given solution from previous runs, see http://jump.readthedocs.io/en/latest/refmodel.html?highlight=internalModel#accessing-the-low-level-model
I mimic https://github.com/JuliaOpt/SCS.jl/blob/master/test/options.jl:

m  #JuMP model
long_solver = SCSSolver(eps=1e5, max_iters=5000)
JuMP.setsolver(m, long_solver)
JuMP.solve(m)
#... Status: Solved
  :Optimal

p_sol = m.internalModel.primal_sol
d_sol = m.internalModel.dual_sol
s = m.internalModel.slack

JuMP.getobjectivevalue(m)
   0.5857824735201506

Now for the warm start:

short_solver = SCSSolver(eps=1e5, max_iters=1, warm_start=true, verbose=true)
JuMP.setsolver(m, short_solver)
JuMP.build(m)
MathProgBase.SolverInterface.setwarmstart!(m.internalModel, p_sol; dual_sol = d_sol, slack=s);
JuMP.solve(m)
#... Status: Unbounded/Inaccurate
JuMP.getobjectivevalue(m)
  1.0000000000000002

so this is not even close; However calling MathProgBase.optimize!(m.internalModel) (as in options.jl from tests) results in warmstart:

#... Status: Solved
  -0.5857616131626189

Is it possible to warmstart JuMP.solve ?

If you have a look at JuMP.build, which is called from solve() you’ll see that it discards the internal conic model before every solve. So it would take some restructuring to accomplish what you’re trying to do.

Also, it seems to me that SCS’s implementation of setwarmstart! is broken for duals and slacks because it doesn’t account for the transformations/permutations that are done between the MathProgBase conic format and SCS conic format, not to mention that dual_sol and slack keyword arguments are not part of the definition of setwarmstart! and shouldn’t be in a method called MathProgBase.setwamstart!.

The tidy path forward (i.e., to get PRs merged) would be to define a warmstarting method for duals and slacks in MathProgBase, implement it correctly in SCS, and then we can consider calling it from JuMP.

Thanks for the explanation; I tried to look-up setwarmstart! before, but there are just 4 sentences of explanation (as You linked);

Since SCS solution actually consists of (primal, dual, slack), maybe treat the tuple as v?
Are the transformations/permutations You mention done in conicdata?

No, I mean the transformations from MathProgBase conic form to SCS’s internal format done here.