CPLEX timeout option error

257 views
Skip to first unread message

Anton Savchenko

unread,
Sep 22, 2014, 11:17:35 AM9/22/14
to yal...@googlegroups.com
Dear Johan,

I noticed that CPLEX lists "timelimit" option instead of "tilim", yet you have hard-coded checks on the option names, that produces an error whenever I run

old_options = sdpsettings
sdpsettings(old_options,'cplex.timelimit',timelimit)

Surprisingly, if there's no old_options input, the function does not produce an error.

Best,
Anton

Johan Löfberg

unread,
Sep 22, 2014, 11:22:41 AM9/22/14
to yal...@googlegroups.com
YALMIP does not hard-code any options for any reasonably modern version of CPLEX. The hard-coded part is obtained when YALMIP doesn't find any installed version of cplex, and this is a left-over from pre-historic times when cplexint was the interface of choice. Hence, if you get an cplex options structure with tilim, there is something wrong with your setup

>> which cplex
'cplex' not found.
>> ops = sdpsettings;
>> ops.cplex

ans
=

       presol
: 1
        niter
: 1
        epgap
: 1.0000e-04
       epagap
: 1.0000e-06
    relobjdif
: 0
       objdif
: 0
        tilim
: 1.0000e+75
      logfile
: 0
        param
: [1x1 struct]


>> addpath(genpath('C:\Program Files\IBM\ILOG\CPLEX_Enterprise_Server126\CPLEX_Studio\cplex\matlab'))
>> ops = sdpsettings;
>> ops.cplex

ans
=

           advance
: 1
           barrier
: [1x1 struct]
         clocktype
: 2
          conflict
: [1x1 struct]
      dettimelimit
: 1.0000e+75
           distmip
: [1x1 struct]
          emphasis
: [1x1 struct]
           feasopt
: [1x1 struct]
          lpmethod
: 0
               mip
: [1x1 struct]
           network
: [1x1 struct]
...


Anton Savchenko

unread,
Sep 23, 2014, 7:04:02 AM9/23/14
to yal...@googlegroups.com
Hm, I guess I didn't explain myself properly...

I hope I'm using recent enough cplex version, and it does show timelimit as the option within

>> solvers=getavailablesolvers(0);
>> solvers(2)

ans = 

                   tag: 'CPLEX'
               version: 'IBM'
            subversion: '12.5'
              checkfor: {'cplexqcp.m'  'cplexlink125'}
              testcode: {''}
                  call: 'call_cplexibm_qcmiqp'
               subcall: ''
                  show: 1
             usesother: 0
       supportsinitial: 0
    supportsinitialNAN: 0
             objective: [1x1 struct]
            constraint: [1x1 struct]
                  dual: 1
               complex: 0
              interval: 0
            parametric: 0
            evaluation: 0
             uncertain: 0

>>
which cplex
/apps/numerics/matlab_toolboxes/cplex-ibm/@Cplex/Cplex.p  % Cplex constructor
>> ops = sdpsettings;
>> ops.cplex


ans
=


           advance
: 1
           barrier
: [1x1 struct]
         clocktype
: 2
          conflict
: [1x1 struct]
      dettimelimit
: 1.0000e+75

          emphasis
: [1x1 struct]
           feasopt
: [1x1 struct]
          lpmethod
: 0
               mip
: [1x1 struct]

            output
: [1x1 struct]
          parallel
: 0
     preprocessing
: [1x1 struct]
          qpmethod
: 0
        randomseed
: 201207272
              read
: [1x1 struct]
           sifting
: [1x1 struct]
           simplex
: [1x1 struct]
    solutiontarget
: 0
           threads
: 0
         timelimit
: 1.0000e+75
              tune
: [1x1 struct]
           workdir
: '.'
           workmem
: 128
       diagnostics
: 'off'
       exportmodel
: ''

The problem is that when I try modifying it using YALMIP sdpsettings function, it produces an error:

>> sdpsettings(ops,'cplex.timelimit',1)
Error using sdpsettings (line 1655)
Unrecognized property name 'cplex.timelimit'.

While if I try using the old syntax, it passes through:
 
>> newops = sdpsettings(ops,'cplex.tilim',1);
>> newops.cplex


ans
=


           advance
: 1

           barrier
: [1x1 struct]
         clocktype
: 2
          conflict
: [1x1 struct]
      dettimelimit
: 1.0000e+75

          emphasis
: [1x1 struct]
           feasopt
: [1x1 struct]
          lpmethod
: 0
               mip
: [1x1 struct]

            output
: [1x1 struct]
          parallel
: 0
     preprocessing
: [1x1 struct]
          qpmethod
: 0
        randomseed
: 201207272
              read
: [1x1 struct]
           sifting
: [1x1 struct]
           simplex
: [1x1 struct]
    solutiontarget
: 0
           threads
: 0
         timelimit
: 1.0000e+75
              tune
: [1x1 struct]
           workdir
: '.'
           workmem
: 128
       diagnostics
: 'off'
       exportmodel
: ''
             tilim
: 1

This is the reason I haven't caught on to this for so long. When I checked what's happening inside the sdpsettings, I saw that by the point when you check the option name, you compare it somehow with the "names" list for option names, that seems to contain tilim.

Johan Löfberg

unread,
Sep 23, 2014, 9:38:30 AM9/23/14
to yal...@googlegroups.com
Aha. Well that is definitely a bug. Thanks for reporting.

The following work-around is equivalent
ops = sdpsettings;
ops
.cplex.timelimit = 1;
Reply all
Reply to author
Forward
0 new messages