Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
Expand all | Collapse all

Out of memory error (Cplex-Matlab)

  • 1.  Out of memory error (Cplex-Matlab)

    Posted 03/24/12 09:43 AM

    Originally posted by: Sothea


    Dear Jonh Cui

    I am writing to you a new topic concerning out of memory because i still dont understand my problem. As information in cplex.log file i send you in attachment, the tree size is about 54 Mo and my machine's memory is 2Go, why out of memory error happend? I checked also the solution as explaining in the link you had told me http://www-01.ibm.com/support/docview.wss?uid=swg21400051
    but i dont find the solution which can deal my problem.

    Please kindly help me to fix it.

    Thanks in advance,
    Sothea
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Out of memory error (Cplex-Matlab)

    Posted 03/24/12 09:53 AM

    Originally posted by: Sothea


    One more thing for precision, when i program this problem in OPL studio, i got the solution without out of memory error.
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Out of memory error (Cplex-Matlab)

    Posted 03/24/12 11:34 AM

    Originally posted by: John Cui


    Did you solve the same problem in OPL? How much time you used to solve the problem in OPL?

    John Cui
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Out of memory error (Cplex-Matlab)

    Posted 03/25/12 05:58 AM

    Originally posted by: Sothea


    Dear Jonh Cui,

    Yes i solved the same problem. I didn't save the solution at that time but if i dont confuse, machine run about 13h to get solution using OPL program.

    Please kindly help me.

    thanks,
    sothea
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Out of memory error (Cplex-Matlab)

    Posted 03/26/12 09:32 AM

    Originally posted by: Sothea


    Dear John Cui,

    Concerning the out of memory problem, i tried all the best to deal it. I tried to increase memory work to 1024MB and get options.mip.strategy.file =3 in order to use node file . nodefile was not created. I also increase memory by /fastdetect switch: /3GB. But i still cannot can fix the problem. Here is the last lines of cplex.log. The tree size is only 95.76 MB however workmem=1024MB. Can you explain me and how to fix it?
    Elapsed real time = 3998.97 sec. (tree size = 95.76 MB, solutions = 10)
    173044 94378 -1.8856 220 -1.7185 -1.9173 10305717 11.57%

    There may be further error information in the clone logs.
    Cover cuts applied: 1
    Implied bound cuts applied: 110
    Mixed integer rounding cuts applied: 26
    Zero-half cuts applied: 14
    Multi commodity flow cuts applied: 2
    Gomory fractional cuts applied: 8

    Root node processing (before b&c):
    Real time = 2.03
    Parallel b&c, 2 threads:
    Real time = 4017.59
    Sync time (average) = 0.08
    Wait time (average) = 0.00

    Total (root+branch&cut) = 4019.63 sec.
    Warning: MIP starts not constructed because of out-of-memory status.
    ??? Error using ==> cplexmiqp at 335
    CPLEX Error 1001: Out of memory.
    Error in ==> gignac_miqp_m2010_2_0 at 851
    x,obj,exitflag,output]=cplexmiqp(H,f,Aineq,bineq,Aeq,beq,[,],[,lb,ub,ctype,[],options);

    >> options

    options =

    advance: 1
    barrier: 1x1 struct
    clocktype: 2
    conflict: 1x1 struct
    dettimelimit: 1.0000e+075
    emphasis: 1x1 struct
    feasopt: 1x1 struct
    lpmethod: 0
    mip: 1x1 struct
    output: 1x1 struct
    parallel: 0
    preprocessing: 1x1 struct
    qpmethod: 0
    read: 1x1 struct
    sifting: 1x1 struct
    simplex: 1x1 struct
    solutiontarget: 0
    threads: 0
    timelimit: 1.0000e+075
    tune: 1x1 struct
    workdir: 'H:\ESPACE_TRAVAIL\MATLAB-CPLEX\Gignac\simulation_paper'
    workmem: 1024
    diagnostics: 'on'
    exportmodel: ''
    Exportmodel: 'debug.lp'

    >> options.mip.strategy

    ans =

    backtrack: 0.9999
    bbinterval: 7
    branch: 0
    dive: 0
    file: 3
    fpheur: 0
    heuristicfreq: 0
    kappastats: 0
    lbheur: 0
    miqcpstrat: 0
    nodeselect: 1
    order: 1
    presolvenode: 0
    probe: 0
    rinsheur: 0
    search: 0
    startalgorithm: 0
    subalgorithm: 0
    variableselect: 0

    >>

    Thanks

    Sothea
    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Out of memory error (Cplex-Matlab)

    Posted 03/26/12 10:31 AM

    Originally posted by: John Cui


    Could you please set options.mip.strategy.presolvenode = 2 and options.mip.strategy.probe = 3, and try again?
    John Cui
    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: Out of memory error (Cplex-Matlab)

    Posted 03/26/12 11:02 AM

    Originally posted by: John Cui


    I got the optimal solution in aound 1000s:
    
    Elapsed real time = 1084.41 sec. (tree size =  0.27 MB, solutions = 19) 43391    75        cutoff             -1.7213       -1.7218  4363212    0.03% 43392    74       -1.7214    80       -1.7213       -1.7218  4363220    0.03% 43393    73        cutoff             -1.7213       -1.7218  4363221    0.03% 43394    72        cutoff             -1.7213       -1.7218  4363227    0.03% 43395    71        cutoff -1.7213       -1.7218  4363230    0.03% 43396    71       -1.7214    22       -1.7213       -1.7218  4363234    0.03% 43397    70        cutoff             -1.7213       -1.7218  4363240    0.03% 43398    69        cutoff             -1.7213       -1.7218  4363243    0.03% 43399    68        cutoff             -1.7213       -1.7218  4363247    0.03% 43400    67        cutoff             -1.7213       -1.7218  4363249    0.03% Elapsed real time = 1084.46 sec. (tree size =  0.27 MB, solutions = 19) 43401    66        cutoff             -1.7213       -1.7218  4363250    0.03% 43402    65       -1.7214   113       -1.7213       -1.7218  4363254    0.03%   Clique cuts applied:  24 Cover cuts applied:  19 Implied bound cuts applied:  276 Mixed integer rounding cuts applied:  1 Zero-half cuts applied:  14 Multi commodity flow cuts applied:  2   Root node processing (before b&c): Real time             =    1.92 Parallel b&c, 2 threads: Real time             = 1082.51 Sync time (average)   =    0.07 Wait time (average)   =    4.47 ------- Total (root+branch&cut) = 1084.43 sec.   Solution pool: 19 solutions saved.   MIP - Integer optimal, tolerance (0.0001/1e-006):  Objective = -1.7212510848e+000 Current MIP best bound = -1.7214218085e+000 (gap = 0.000170724, 0.01%) Solution time = 1084.47 sec.  Iterations = 4363254  Nodes = 43403 (65) Deterministic time = 575213.40 ticks  (530.41 ticks/sec)
    

    #CPLEXOptimizers
    #DecisionOptimization


  • 8.  Re: Out of memory error (Cplex-Matlab)

    Posted 03/26/12 12:40 PM

    Originally posted by: John Cui


    Let's go further, if you set below parameters in CPLEX 12.4:

    
    mip limits cutpasses -1 mip strategy presolvenode 2 mip strategy probe 3 mip strategy variableselect 4
    


    The problem will be solved in 1 minute around:

    
    Tried aggregator 1 time. MIQP Presolve eliminated 2508 rows and 815 columns. MIQP Presolve modified 3871 coefficients. Reduced MIQP has 1888 rows, 937 columns, and 8382 nonzeros. Reduced MIQP has 587 binaries, 350 generals, 0 SOSs, and 0 indicators. Reduced MIQP objective Q matrix has 12 nonzeros. Presolve time =    0.02 sec. Probing fixed 0 vars, tightened 1 bounds. Probing added 4921 nonzeros. Probing time =    0.05 sec. Clique table members: 7519. MIP emphasis: balance optimality and feasibility. MIP search method: dynamic search. Parallel mode: deterministic, using up to 2 threads. Root relaxation solution time =    0.62 sec.   Nodes                                         Cuts/  Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap   0     0       -2.0887   345                     -2.0887      111 0     2       -2.0887   345                     -2.0887      111 Elapsed real time =   1.15 sec. (tree size =  0.01 MB, solutions = 0) 5     7       -1.8962   233                     -2.0871     3971 25    25       -1.8448   194                     -2.0864     8392 42    28       -1.9072   282                     -2.0858    13808 54    36       -0.9006   243                     -2.0858    18320 69    47       -1.9505   265                     -2.0858    24027 84    52       -2.0003   305                     -2.0858    30049 90    56    infeasible                           -2.0811    36876 104    64        1.4639   263                     -2.0811    44147 120    72       -2.0419   305                     -2.0809    50765 170    97       -1.7424   189                     -2.0584    77169 Elapsed real time =   7.11 sec. (tree size =  0.06 MB, solutions = 0) 230   122       -1.9197   179                     -2.0159   103286 310   154       -1.6164   189                     -1.9865   127071 398   172       -1.6570   137                     -1.9574   153104 465   173       -1.6548   147                     -1.9317   181972 529   187       -1.7236   202                     -1.9030   207907 629   234       -1.8135   218                     -1.8955   230378 735   272       -1.8164   224                     -1.8875   255865 832   312       -1.6968   197                     -1.8777   277232 919   338       -1.7920   232                     -1.8706   301320 1000   341       -1.8432   192                     -1.8609   327946 Elapsed real time =  26.93 sec. (tree size =  0.27 MB, solutions = 0) 1071   332      334.2118   231                     -1.8461   354434 1172   348        4.4121   195                     -1.8298   378195 1265   357       -1.7414   157                     -1.8225   404785 1365   361       -1.7256   195                     -1.8153   429785 1487   372       -1.7634   171                     -1.8054   453416 1607   365       -1.5471   221                     -1.7972   476477 1746   382       -1.7455   214                     -1.7895   500418 1862   385    infeasible                           -1.7845   525729 2012   357    infeasible                           -1.7762   551119 2157   378       -1.7617   165                     -1.7728   576561 Elapsed real time =  49.47 sec. (tree size =  0.29 MB, solutions = 0) *  2299+  391                           -1.7115       -1.7706   591187    3.45% 2352   348       -1.7398   138       -1.7115       -1.7672   596575    3.25% 2576   335       -1.7592   152       -1.7115       -1.7615   615180    2.92% *  2610   342      integral     0       -1.7139       -1.7615   617474    2.78% *  2612   342      integral     0       -1.7143       -1.7615   617479    2.75% *  2696+  389                           -1.7152       -1.7597   620452    2.60% *  2699+  391                           -1.7163       -1.7597   620462    2.53% *  2834+  404                           -1.7167       -1.7568   628517    2.33% *  2843   406      integral     0       -1.7190       -1.7568   628710    2.20% *  2909   416      integral     0       -1.7193       -1.7568   632538    2.18% *  3055+  447                           -1.7198       -1.7541   638486    1.99% *  3066+  446                           -1.7209       -1.7541   638779    1.92% *  3260+  500                           -1.7212       -1.7541   647745    1.91% 3276   477       -1.7276    86       -1.7212       -1.7508   648985    1.72% 3581   420       -1.7222    48       -1.7212       -1.7488   667073    1.60% 3953   372        cutoff             -1.7212       -1.7308   684491    0.56% *  3996   368      integral     0       -1.7213       -1.7308   685744    0.55% Elapsed real time =  61.34 sec. (tree size =  0.31 MB, solutions = 14) 4547   345       -1.7218    19       -1.7213       -1.7275   700922    0.36% 5278    56        cutoff             -1.7213       -1.7237   711591    0.14%   Root node processing (before b&c): Real time             =    1.12 Parallel b&c, 2 threads: Real time =   64.68 Sync time (average)   =    0.00 Wait time (average)   =    1.60 ------- Total (root+branch&cut) =   65.80 sec.   Solution pool: 15 solutions saved.   MIP - Integer optimal, tolerance (0.0001/1e-006):  Objective = -1.7212510848e+000 Current MIP best bound = -1.7213954883e+000 (gap = 0.000144404, 0.01%) Solution time =   65.83 sec.  Iterations = 711926  Nodes = 5340 (7) Deterministic time = 31206.97 ticks  (474.04 ticks/sec)
    


    John Cui
    #CPLEXOptimizers
    #DecisionOptimization


  • 9.  Re: Out of memory error (Cplex-Matlab)

    Posted 03/26/12 01:45 PM

    Originally posted by: Sothea


    Thanks so much for your time to test it for me. I don't know what's strange to my machine, however i set all options as you told me, i still have the same problem. Here is my command,

    options = cplexoptimset('cplex');
    options.mip.limits.cutpasses=-1;
    options.mip.strategy.file = 3;
    options.mip.strategy.presolvenode=2;
    options.mip.strategy.probe=3;
    options.mip.strategy.variableselect=4;
    options.workdir='H:\ESPACE_TRAVAIL\MATLAB-CPLEX';
    options.workmem=1024;
    options.Exportmodel = 'debug.lp';
    options.diagnostics = 'on';

    % solver
    x,obj,exitflag,output]=cplexmiqp(H,f,Aineq,bineq,Aeq,beq,[,],[,lb,ub,ctype,[],options);

    It seems that all options i set are not activated. Do you have any ideas of this problem?

    Thanks
    #CPLEXOptimizers
    #DecisionOptimization


  • 10.  Re: Out of memory error (Cplex-Matlab)

    Posted 03/26/12 07:01 PM

    Originally posted by: John Cui


    Issuses in your code:

    1. please only set cutpasses, presolvenode, probe, variableselect and diagnostics parrameters.
    2. Exportmodel should be exportmodel, cplexoptimset('cplex') only has exportmodel option.
    3. Please check cplexmiqp input parameters:
    cplexmiqp(H,f,Aineq,bineq,Aeq,beq,[],[],[],lb,ub,ctype,[],options)
    

    John Cui
    #CPLEXOptimizers
    #DecisionOptimization


  • 11.  Re: Out of memory error (Cplex-Matlab)

    Posted 03/27/12 03:18 AM

    Originally posted by: Sothea


    Dear John Cui,

    Thanks a lot. In fact, the problem is only caused by Exportmodel "on".

    Best regards,
    Sothea
    #CPLEXOptimizers
    #DecisionOptimization


  • 12.  Re: Out of memory error (Cplex-Matlab)

    Posted 03/27/12 03:21 AM

    Originally posted by: John Cui


    Then I guess, you have solved the problem in 1 minute around?

    John Cui
    #CPLEXOptimizers
    #DecisionOptimization


  • 13.  Re: Out of memory error (Cplex-Matlab)

    Posted 03/27/12 03:24 AM

    Originally posted by: Sothea


    Yes, the problem can be solved 90s.

    Thanks a lot.
    #CPLEXOptimizers
    #DecisionOptimization


  • 14.  Re: Out of memory error (Cplex-Matlab)

    Posted 04/13/12 03:40 AM

    Originally posted by: Sothea


    Dear John Cui,

    I still have out of memory problem when i increase variable dimensions as you see in the file attached below. Nodefile was created during the process but that problem still happends, is it normal? Is it limited the size? The problem resolved has only 1307 variables and 3350 constrains. I don't think the Cplex cannot deal this problem. I also wonder the calculate time why it is too long. I tried to change MIP stragtegie but the time is still long. Don't think it is cause of my problem formulation? Cplex has any limits of MIQP?

    I run it with Windows XP pack 3, Intel core 2 CPU, 6400@2.13GHz, RAM 2,00Go.

    Thanks again for your help.

    Best regards,
    Sothea HONG
    #CPLEXOptimizers
    #DecisionOptimization


  • 15.  Re: Out of memory error (Cplex-Matlab)

    Posted 04/13/12 03:41 AM

    Originally posted by: Sothea


    new question
    #CPLEXOptimizers
    #DecisionOptimization


  • 16.  Re: Out of memory error (Cplex-Matlab)

    Posted 04/13/12 04:55 AM

    Originally posted by: John Cui


    You even didn't find any solution from your log file, could you attach your model file to here, then I can give a try?
    John Cui
    #CPLEXOptimizers
    #DecisionOptimization


  • 17.  Re: Out of memory error (Cplex-Matlab)

    Posted 04/13/12 10:25 AM

    Originally posted by: Sothea


    Please find it in attachment below.

    thanks so much,
    Sothea
    #CPLEXOptimizers
    #DecisionOptimization


  • 18.  Re: Out of memory error (Cplex-Matlab)

    Posted 04/13/12 10:27 AM

    Originally posted by: Sothea


    another problem, it concerns more variables than the last one.
    #CPLEXOptimizers
    #DecisionOptimization


  • 19.  Re: Out of memory error (Cplex-Matlab)

    Posted 04/16/12 05:26 AM

    Originally posted by: John Cui


    Please use below parameters and give a try.

    emphasis mip 1
    emphasis numerical yes
    mip strategy heuristicfreq 10
    mip strategy rinsheur 10
    read scale 1
    


    And also, you should use cplexoptimset('cplex'), and diagnostics ,exportmodel .
    options = cplexoptimset('cplex');
    ...
    options.diagnostics = 'on';
    options.exportmodel = 'miqp_m2010.sav';
    


    John Cui
    #CPLEXOptimizers
    #DecisionOptimization