Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Peak Memory Query

    Posted Wed October 19, 2011 03:33 PM

    Originally posted by: UDOPS


    Is there a call I can use, similar to cplex.getNrows(), to return the peak memory of a solution? I searched the help and did not find one.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Peak Memory Query

    Posted Thu October 20, 2011 03:02 PM
    Hi,

    have you tried using the profiler?
    oplrun -profile x.mod x.dat

    Regards
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Peak Memory Query

    Posted Mon October 24, 2011 06:52 PM

    Originally posted by: UDOPS


    I am using the profiler in the graphical interface. It's great! But I want to run a series of problems and record the memory consumed for each one. Right now I have to write the value by hand. It would be nice if I could automate this, write the value to file.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: Peak Memory Query

    Posted Fri November 04, 2011 05:02 AM

    Originally posted by: SystemAdmin


    here is an undocumented way to do this while using oplrun.
    When using oplrun -profile, the following example will output the profiler output in the scripting log, which you can redirect for example in a IloOplOutputFile.
    This way, if you launch multiple sub problems, you will be able to see the memory consumption of each of them.
    ======================================================================
    
    range r = 1..10; dvar int+ x[r] in 1..10;   execute PRE 
    { writeln(
    "Hello PRE"); 
    }   execute 
    { writeln(
    "Hello"); 
    }   subject to 
    { ct: sum(i in r) x[i] >= 0; forall(i in r) cts: x[i] >= i; 
    }   execute POST 
    { writeln(
    "Hello POST"); 
    }     main 
    { thisOplModel.generate(); cplex.solve(); thisOplModel.postProcess(); 
    
    static function printProfile(n,prefix) 
    { 
    
    for(; n; n=n.next) 
    { writeln(prefix,
    "n.name = ",n.name); writeln(prefix,
    "n.section = ",n.section); writeln(prefix,
    "n.time = ",n.time); writeln(prefix,
    "n.selfTime = ",n.selfTime); writeln(prefix,
    "n.peakMemory = ",n.peakMemory); writeln(prefix,
    "n.localMemory = ",n.localMemory); printProfile(n.firstChild,prefix+
    "  "); 
    } 
    } writeln(
    "Profiler:"); printProfile(thisOplModel.settings._profilerRootNode,
    "  "); 
    }
    

    ==================================================
    #DecisionOptimization
    #OPLusingCPLEXOptimizer