Closed ulfworsoe closed 9 years ago
That's most likely because we test with some nonconvex problems. We'll have to reorganize the tests a bit to only test Mosek on the convex problems. CC @IainNZ
None of the tests need to be nonconvex, so I'll probably just fix it that way
Working on this now. Mosek seems to be returning MSK_SOL_STA_UNKNOWN
for the following test problem:
using Mosek, JuMP
m = Model(solver=MosekSolver())
@defVar(m, 0.5 <= x <= 2)
@defVar(m, 0.0 <= y <= 30)
@setObjective(m, Min, (x+y)^2)
@addNLConstraint(m, x + y >= 1)
status = solve(m)
@show status
The iterations look fine though:
ITE PFEAS DFEAS GFEAS PRSTATUS POBJ DOBJ MU TIME
0 2.8e+01 4.5e+00 1.0e+01 0.00e+00 6.250000000e+00 -3.250000000e+00 1.0e+00 0.01
1 4.3e+00 6.9e-01 2.3e+00 -8.75e-01 1.427096107e+01 7.710997485e+00 1.8e-01 0.01
2 2.0e+00 3.2e-01 2.7e+00 5.81e-01 3.847813553e+00 -6.300554270e+00 1.5e-01 0.01
3 2.1e-02 3.3e-03 2.5e-01 5.24e-01 1.445683123e+00 3.260988886e-01 8.6e-03 0.01
4 1.8e-03 2.9e-04 3.7e-02 9.95e-01 1.002343555e+00 8.424114144e-01 1.2e-03 0.01
5 1.7e-05 2.7e-06 3.5e-04 1.00e+00 1.000381567e+00 9.988732098e-01 1.2e-05 0.01
6 8.4e-08 1.3e-08 1.7e-06 1.00e+00 1.000001908e+00 9.999943477e-01 5.8e-08 0.01
7 4.2e-10 6.7e-11 8.7e-09 1.00e+00 1.000000010e+00 9.999999717e-01 2.9e-10 0.01
Interior-point optimizer terminated. Time: 0.01.
@ulfworsoe, this test still seems to be failing. Any idea why the strange return status?
That looks a bit funny... From the log it looks like the status should be at least NEAR_OPTIMAL. Do you have the return value from Mosek.optimize()?
I added some debugging statements to Mosek.jl:
optimize(m.task) => 0
soldef => 2
prosta => 0
solsta => 0
I cannot rule out that it is a bug in the solver that sets a wrong status. I will try to debug it.
It could also be a bug in the NLP wrapper I wrote.
A very quick test: If I insert
solutionsummary(task_,MSK_STREAM_LOG)
println(getsolsta(task_,MSK_SOL_ITR))
in the Mosek.optimize()
function, immediately after the native function has been called, I can see that the interior-point solution is optimal, and that solution status for MSK_SOL_ITR
is 1 (optimal). Is it possible that you accidentally modify the task so the status changes after optimize()
?
It looks like you ask for the integer solution, MSK_SOL_ITG
, rather than the interior, MSK_SOL_ITR
.
Right, getsoldef
is returning MSK_SOL_ITG
:
solutiondef(m.task,MSK_SOL_ITG) => true
solutiondef(m.task,MSK_SOL_BAS) => true
solutiondef(m.task,MSK_SOL_ITR) => true
Yes, I can see that. I am not sure where those solutions come from... Do you at any point input an initial solution or somthing like that?
Yes, JuMP always gives a starting point: https://github.com/JuliaOpt/Mosek.jl/blob/master/src/MosekSolverInterface.jl#L719 It looks like this logic needs to be tweaked?
You could check if solution is defined and not unknown, perhaps? Problem is that MOSEK will not delete an inputted solution.
Mosek reports "nonconvex problem" during first test in
Trace: