SDP Solver information

384 views
Skip to first unread message

matkabhai asd

unread,
Jul 21, 2016, 10:47:18 AM7/21/16
to YALMIP
Hello Sir,

 I am in solving in matlab  a sdp involving two 400 x 400 PSD matrix variables, two 200 x 200 full variables and two 160000 x 1 vector variables. I am using Yalmip with mosek-sdp  free version solver. I also need the dual variables when the problem is solved. Beyond 100 x 100, the computation time is very very slow for one solving instance of the problem. I have to solve the problem repeatedly in an iterative algorithm. Is there any way to speed up the computation?  If I use (buy) professional solver like "pensdp" or any other paid solver in Yalmip will it help?

I am asking this question as I have never used pensdp. Also if I use pensdp will I be able to recover the dual variables?

Thank you and Regards,
PVC

Johan Löfberg

unread,
Jul 21, 2016, 10:50:44 AM7/21/16
to yal...@googlegroups.com
Mosek is a very good solver, so you are probably stuck with the performance you have (i.e., you have a large problem, so it will be slow), unless you exploit structure and/or go for a low-precision first-order solver such as sdpnal, which might work if your problem is suitable for that solver.

However, it could be that you've created a bad model, so if you show us the model, we could see if there are any obvious things to do
Message has been deleted

PVC

unread,
Jul 21, 2016, 10:42:43 PM7/21/16
to YALMIP
Hello Sir,

Thank you for the prompt reply. I am trying to use new version of sdpnal+, but when I try to run the program, it says, solver not found. I have also set the path. Also some vector variables have a negative lower bound and can take negative values. Can you please guide?

Regards,
PVC

Erling D. Andersen

unread,
Jul 22, 2016, 2:16:51 AM7/22/16
to YALMIP
MOSEK is actually a paid solver that academics can use freely. Are you using the latest version 8 beta?

You are welcome to contact MOSEK support and give us the problem and we can take a look at the problem.

Johan Löfberg

unread,
Jul 22, 2016, 3:47:30 AM7/22/16
to YALMIP
YALMIP searches for the file sdpnalplus, hence it must be in your path. If they have renamed it, you would have to hack it (or callsdpnal.m) to addhere to YALMIPs assumption

PVC

unread,
Jul 22, 2016, 10:21:18 AM7/22/16
to YALMIP
Hello Sir,

Thank you for the reply. I tried sdpnalplus and other combinations too but still it says unknown solver or solver not found. I still have some doubts,

1. What do you imply by  ----  to hack it (or callsdpnal.m) to addhere to YALMIPs assumption ?

2.  How to use callsdpna.m?

3. I have followed all instructions from SDPNAL+ site,

http://www.math.nus.edu.sg/~mattohkc/SDPNALplus.html



4. When I enter  "ops = sdpsettings" in matlab command window I get a list of solvers, which also has, --- sdpnal: [1x1 struct]?

Can you PLease help in resolving my issue?


@Erling Sir, : I am using mosek 7 but will try now with mosek 8.

Regards,
Prasad 





Johan Löfberg

unread,
Jul 24, 2016, 4:48:30 AM7/24/16
to YALMIP
As far as I can tell, their new version main file still has the name sdpnalplus.m, hence YALMIP will find sdpnal if your path is setup correctly.

PVC

unread,
Jul 24, 2016, 8:29:06 AM7/24/16
to YALMIP
Hi Sir,

 I have put solver as sdpnal and used debug and I get the following error,

Error using sdpnal
Too many input arguments.

Error in callsdpnal (line 32)
    [obj,X,y,Z,info,runhist] =  sdpnal(blk,A,C,b,options.sdpnal);

Error in solvesdp (line 329)
    eval(['output = ' solver.call '(interfacedata);']);

Error in optimize (line 31)
varargout{:} = solvesdp(varargin{:});

Error in primal2x (line 22)
di = optimize(Co,Ob,option1)

Error in testpd2 (line 30)
[f1x,Z1,X1] = primal2x(A,B,n,nb);

Can you Please help me to proceed?

Regards,
PVC

Johan Löfberg

unread,
Jul 24, 2016, 8:31:02 AM7/24/16
to YALMIP
You're using an old version of YALMIP

PVC

unread,
Jul 24, 2016, 10:42:17 PM7/24/16
to YALMIP
Hello Sir,

 I am using the latest version of Yalmip, (Release 20150918). I am pasting the test code below,


---------------------------------------------------------------------------------------------------------------------------------------------------------------------

A = [0 1;-1 -2];
n = 2;
nb = 1;

B = [0 1]';
R = eye(nb);
Q = eye(n);
X = sdpvar(n,n);
S1 = [A'*X+X*A+Q X*B;B'*X R];
 
 
 Ob = -trace(X);

Co = [S1>=0;X>=0];
ops1 = sdpsettings('solver','sdpnal','verbose',2','debug',1);

di = optimize(Co,Ob,ops1)

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

The output is,

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Error using validate
Too many input arguments.

Error in sdpnalplus (line 57)
   [At,C,b,L,U,Bt,l,u,par] = validate(blk,AA,C,b,L,U,BB,l,u);

Error in callsdpnal (line 32)
            [obj,X,s,y,Z,Z2,y2,v,info,runhist] =
            sdpnalplus(blk,A,C,b,[],[],[],[],[],options.sdpnal);

Error in solvesdp (line 335)
    eval(['output = ' solver.call '(interfacedata);']);

Error in optimize (line 31)
[varargout{1:nargout}] = solvesdp(varargin{:});

Error in testsdpnal1 (line 26)
di = optimize(Co,Ob,ops1)


---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Sorry to bother you but I am not able to resolve the problem.

Regards,
PVC


PVC

unread,
Jul 24, 2016, 11:46:22 PM7/24/16
to YALMIP
Hello Sir,

it seems you need to use "sdpnal+" instead of "sdpnal" and then it works.

PVC

unread,
Jul 26, 2016, 11:23:18 AM7/26/16
to YALMIP
Hello Sir,

 I used sdpnal but it was not of much help. It seems I need computer with bigger memory to tackle the large system. I am using citrix to solve the problem on matlab installed on a remote computer. I am using Yalmip for it. Since the problem has to use solvers (mosek, gurobi) installed on C-drive of my computer I am getting NaNs as output. When I run yalmiptest.m to check solvers, I am getting following error message. 

|                   Test|   Solution|                                                                                                                                                        Solver message|
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|   Core functionalities|        N/A|                                                                                                                                          Successfully solved (YALMIP)|
|                     LP|        N/A|                   Unknown problem in solver (Turn on 'debug' in sdpsettings) (Invalid MEX-file '\\Client\C$\gurobi652\win64\matlab\gurobi.mexw64': Access is denied.)|
|                     LP|        N/A|                   Unknown problem in solver (Turn on 'debug' in sdpsettings) (Invalid MEX-file '\\Client\C$\gurobi652\win64\matlab\gurobi.mexw64': Access is denied.)|
|                     QP|        N/A|                   Unknown problem in solver (Turn on 'debug' in sdpsettings) (Invalid MEX-file '\\Client\C$\gurobi652\win64\matlab\gurobi.mexw64': Access is denied.)|
|                     QP|        N/A|                   Unknown problem in solver (Turn on 'debug' in sdpsettings) (Invalid MEX-file '\\Client\C$\gurobi652\win64\matlab\gurobi.mexw64': Access is denied.)|
|                   SOCP|        N/A|                   Unknown problem in solver (Turn on 'debug' in sdpsettings) (Invalid MEX-file '\\Client\C$\gurobi652\win64\matlab\gurobi.mexw64': Access is denied.)|
|                   SOCP|        N/A|                   Unknown problem in solver (Turn on 'debug' in sdpsettings) (Invalid MEX-file '\\Client\C$\gurobi652\win64\matlab\gurobi.mexw64': Access is denied.)|
|                   SOCP|        N/A|                   Unknown problem in solver (Turn on 'debug' in sdpsettings) (Invalid MEX-file '\\Client\C$\gurobi652\win64\matlab\gurobi.mexw64': Access is denied.)|
|                    SDP|        N/A|   Unknown problem in solver (Turn on 'debug' in sdpsettings) (Invalid MEX-file '\\Client\C$\Program Files\Mosek\7\toolbox\r2009b\mosekopt.mexw64': Access is denied.)|
|                    SDP|        N/A|   Unknown problem in solver (Turn on 'debug' in sdpsettings) (Invalid MEX-file '\\Client\C$\Program Files\Mosek\7\toolbox\r2009b\mosekopt.mexw64': Access is denied.)|
|                    SDP|        N/A|   Unknown problem in solver (Turn on 'debug' in sdpsettings) (Invalid MEX-file '\\Client\C$\Program Files\Mosek\7\toolbox\r2009b\mosekopt.mexw64': Access is denied.)|
|                    SDP|        N/A|   Unknown problem in solver (Turn on 'debug' in sdpsettings) (Invalid MEX-file '\\Client\C$\Program Files\Mosek\7\toolbox\r2009b\mosekopt.mexw64': Access is denied.)|
|                 MAXDET|        N/A|   Unknown problem in solver (Turn on 'debug' in sdpsettings) (Invalid MEX-file '\\Client\C$\Program Files\Mosek\7\toolbox\r2009b\mosekopt.mexw64': Access is denied.)|
|                 MAXDET|        N/A|   Unknown problem in solver (Turn on 'debug' in sdpsettings) (Invalid MEX-file '\\Client\C$\Program Files\Mosek\7\toolbox\r2009b\mosekopt.mexw64': Access is denied.)|
|          Infeasible LP|        N/A|                   Unknown problem in solver (Turn on 'debug' in sdpsettings) (Invalid MEX-file '\\Client\C$\gurobi652\win64\matlab\gurobi.mexw64': Access is denied.)|
|          Infeasible QP|        N/A|                   Unknown problem in solver (Turn on 'debug' in sdpsettings) (Invalid MEX-file '\\Client\C$\gurobi652\win64\matlab\gurobi.mexw64': Access is denied.)|
|         Infeasible SDP|        N/A|   Unknown problem in solver (Turn on 'debug' in sdpsettings) (Invalid MEX-file '\\Client\C$\Program Files\Mosek\7\toolbox\r2009b\mosekopt.mexw64': Access is denied.)|
|      Moment relaxation|        N/A|   Unknown problem in solver (Turn on 'debug' in sdpsettings) (Invalid MEX-file '\\Client\C$\Program Files\Mosek\7\toolbox\r2009b\mosekopt.mexw64': Access is denied.)|
|         Sum-of-squares|        N/A|   Unknown problem in solver (Turn on 'debug' in sdpsettings) (Invalid MEX-file '\\Client\C$\Program Files\Mosek\7\toolbox\r2009b\mosekopt.mexw64': Access is denied.)|
|           Bilinear SDP|        N/A|                                                                                                                                                    No suitable solver|
++++++++++++++++++++++++++++++++++++++++++++++


Can you Please help me?

Regards,
Prasad


Can 

Johan Löfberg

unread,
Jul 26, 2016, 1:14:09 PM7/26/16
to YALMIP
obviously your mex files don't work on your machine
Message has been deleted

PVC

unread,
Jul 26, 2016, 2:08:29 PM7/26/16
to YALMIP

Hello Sir,

You are right. Mex files on my machine cannot be used by the remote machine on which I am executing the code remotely using citrix. Is there any workaround ?

Also, if I use C++ to solve the problem, will it help in increasing the speed of computation for big systems?

Regards,
Prasad

Johan Löfberg

unread,
Jul 26, 2016, 3:18:03 PM7/26/16
to YALMIP
you have to intall the solver on the machine where you run it

Erling D. Andersen

unread,
Jul 27, 2016, 2:44:18 AM7/27/16
to YALMIP
FYI. 

MOSEK version 8 has something called an OptServer. I.e. you can install a MOSEK service/daemon on a remote server. Now it is possible from almost any program to send an optimization problem to the OptServer and then retrieve the solution later. This is particular easy from C/Python/Java/.Net. 




Reply all
Reply to author
Forward
0 new messages