How to change the display setting of CPLEX 12.6.3 in Yalmip and make it show message every iter?

394 views
Skip to first unread message

Xinwei Shen

unread,
Nov 23, 2016, 8:24:53 AM11/23/16
to YALMIP
I want to make MIP solving process show message every iter, so I write

"ops=sdpsettings('solver','cplex','cplex.Display','iter');"

However, it didn't work even though the ops.cplex.Display has become 'iter'

Xinwei Shen

unread,
Nov 23, 2016, 8:54:02 AM11/23/16
to YALMIP
I found out that it's because the MIP log information is not enough.


Now I want to set mip.display=5

How can I make it with the function "sdpsetting"?

Johan Löfberg

unread,
Nov 23, 2016, 9:48:25 AM11/23/16
to YALMIP
ops = sdpsettings('cplex.mip.display',5)

Options + MATLAB + cplex has been a disaster since day 1 though, so I wouldn't be surprised if it simply doesn't work. For instance cplex+matalb 2016b crashes if the complete options structure is used, and cplex 12.6.2 and earlier completely disregarded options, and some versions have behaved very strangely with display options.

You'll have to put a break in call_cplexibm_miqp to see if the option actually is set when the call is made to binary. If it is, and you don't get the display you expect, you're simply seeing yet another issue with cplex display issues


Xinwei Shen

unread,
Nov 24, 2016, 12:25:47 AM11/24/16
to YALMIP
It showed 
"Unrecognized property name 'cplex.mip.display' ",
it seems that there's no such structure in ops.cplex.
Thanks anyway.

Mark L. Stone

unread,
Nov 24, 2016, 12:33:39 AM11/24/16
to YALMIP
Look up and use the parameter number per my post in https://groups.google.com/forum/#!topic/yalmip/A8mMjAyAlhA . I don't know whether that will work for you, but it's worth a try.

Johan Löfberg

unread,
Nov 24, 2016, 3:23:26 AM11/24/16
to YALMIP
If you are using MATLAB 2016a or earlier, you have that option
>> ops = sdpsettings;
>> ops.cplex.mip.display

ans =

     2


In MATLAB2016b + 12.6.3, there is a bug which causes cplex to crash if we use the complete options structure, so YALMIP only creates cplex limited set of options

Xinwei Shen

unread,
Nov 28, 2016, 7:02:52 AM11/28/16
to YALMIP
It's very strange that There is no "ops.cplex.mip" in my YALMIP.
>> opss=sdpsettings;
>> opss.cplex

ans = 

                Display: 'on'
                MaxIter: 9.2234e+18
              Algorithm: 'auto'
         BranchStrategy: 'maxinfeas'
               MaxNodes: 9.2234e+18
                MaxTime: 1.0000e+75
    NodeDisplayInterval: 20
     NodeSearchStrategy: 'bn'
                 TolFun: 1.0000e-06
              TolRLPFun: 1.0000e-06
            TolXInteger: 1.0000e-05
            ExportModel: ''

What happened to my YALMIP or matlab or CPLEX?

Johan Löfberg

unread,
Nov 28, 2016, 10:27:12 AM11/28/16
to YALMIP
As I said in the previous answer. You're using cplex on matlab 2016. cplex has a bug on matlab 2016, and to avoid cplex to crash matlab, YALMIP only allows cplex to create a limited set of options. If you look in sdpsettings

if strfind(version,'2016')
        cplex = cplexoptimset;
    else
        cplex = cplexoptimset('cplex');
        cplex.output.clonelog = 0;
    end   

if you run cplexoptimset('cplex') on your machine, it will very likely crash. If it doesn't, you can remove the check for version and simply change it to cplex = cplexoptimset('cplex');
        cplex.output.clonelog = 0;, and the complete options structure will be created.

Xinwei Shen

unread,
Nov 28, 2016, 10:14:29 PM11/28/16
to YALMIP
It seems that there is no problem for me to "remove the check for version", nothing crashes.

Btw, 
My Matlab version is R2016a; 
Cplex version is 12.6.3.0; 
Windows version is Win10 Education 64-bit.

Johan Löfberg

unread,
Nov 29, 2016, 4:22:26 AM11/29/16
to YALMIP
Yes, I think the a-version works, problem is only in b

reza mehrabadi

unread,
Dec 16, 2018, 2:25:36 AM12/16/18
to YALMIP
Hi. I've tested the following code (latest ver. YALMIP and 2018b(also 2016a) + cplex 12.7.1) to have more info while solving:
ops = sdpsettings('solver','cplex','cplex.display','on');
%ops.verbose= 2;
%ops.barrier.display=2;
ops.cplex.mip.display=3;
%ops.showprogress = 1;

but still no effects and, after the solution completes:

ylm.png

The mip display is still set on 1. Testing again the:

ops.cplex.mip.display

ans =


     3


 

Johan Löfberg

unread,
Dec 16, 2018, 3:15:03 AM12/16/18
to YALMIP
the only working cplex version is 12.8
Reply all
Reply to author
Forward
0 new messages