Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Save Engine Log

    Posted 05/23/08 06:18 AM

    Originally posted by: SystemAdmin


    [sdwow said:]

    How can I save the engine log generated by OPL. I run the opl model via c++/java.  Is there a function that returns this log?

    Thanks,
    SD
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Save Engine Log

    Posted 05/23/08 08:34 PM

    Originally posted by: SystemAdmin


    [Didier Vidal said:]

    Depending on the optimization engine you use, you can use IloCplex.setOut or IloCP.setOut to redirect the engine log to the java OutputStream you want. If you want to redirect to a file, you can create a FileOutputStream (http://java.sun.com/j2se/1.4.2/docs/api/java/io/FileOutputStream.html)

    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Save Engine Log

    Posted 05/23/08 11:05 PM

    Originally posted by: SystemAdmin


    [sdwow said:]

    Thank you very much. I created a new FileOutputStream and used the function getCplex().setOut() as shown below.

    String name= "NEW_log.txt";
    FileOutputStream log = new FileOutputStream (new File(name));
    oplModel.getCplex().setOut(log);

    However, now I get multiple files. How can I dump it all into a single file?

    I appreciate your help and pointing me to the right direction.
    Thanks,
    SD
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: Save Engine Log

    Posted 05/26/08 01:14 PM

    Originally posted by: SystemAdmin


    [Didier Vidal said:]

    Why don't you use the same file stream for all your CPLEX runs ?
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: Save Engine Log

    Posted 05/27/08 06:55 PM

    Originally posted by: SystemAdmin


    [sdwow said:]

    Yes, I resolved that issue and I do get all the log into one file "NEW_log.txt". however, The file looks like this:

    Tried aggregator 1 time.
    MIQP Presolve eliminated 846 rows and 750 columns.
    Aggregator did 157 substitutions.
    Reduced MIQP has 317 rows, 319 columns, and 1174 nonzeros.
    Presolve time =    0.02 sec.
    MIP emphasis: balance optimality and feasibility.
    MIP search method: dynamic search.
    Parallel mode: none, using 1 thread.
    Root relaxation solution time =    0.00 sec.

          Nodes                                        Cuts/
      Node  Left    Objective  IInf  Best Integer    Best Node    ItCnt    Gap

        400  179        4.3728    11        5.1620        3.7651    2393  27.06%
        500  217        4.2886    17        5.1620        3.8711    3014  25.01%
        600  254        cutoff              5.1620        3.9650    3599  23.19%
        700  285        4.1001    11        5.1620        4.0347    4439  21.84%
        800  301        4.8879    16        5.1620        4.1647    5422  19.32%
        900  310        4.6655    11        5.1620        4.2546    6140  17.58%
      1000  315        4.8482    23        5.1620        4.3610    7079  15.52%
    Elapsed time =  0.47 sec. (tree size =  0.10 MB, solutions = 0)
      1100  299        4.7757    11        5.1620        4.4764    7994  13.28%
      1200  268        4.7769    11        5.1620        4.6220    8793  10.46%
      1300  203        cutoff              5.1620        4.7591    9640    7.81%

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

    However, I do not get the rest of the output which is generally generated by CPLEX and shown by OPL.
    Example:
    Mixed integer rounding cuts applied:  2
    Gomory fractional cuts applied:  3

    OR

    Root node processing (before b&c):
      Real time            =    0.52
    Parallel b&c, 2 threads:
      Real time            =    2.81
      Sync time (average)  =    1.41
      Wait time (average)  =    1.41
                              -------
    Total (root+branch&cut) =    3.33 sec.

    Let me know how I can view or write this into the log file.

    SD
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 6.  Re: Save Engine Log

    Posted 05/27/08 08:48 PM

    Originally posted by: SystemAdmin


    [Didier Vidal said:]

    That's surprising.

    The first thing I would try is to 'flush' the stream after each CPLEX run, by calling


    elog.flush();


    Didier.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 7.  Re: Save Engine Log

    Posted 05/28/08 12:48 AM

    Originally posted by: SystemAdmin


    [sdwow said:]

    Thank you Didier,

    I tried using the flush() stmt. For a very simple problem here is the engine log file that gets saved:

    Tried aggregator 1 time.
    MIP Presolve eliminated 90 rows and 6 columns.
    Aggregator did 157 substitutions.
    Reduced MIP has 81 rows, 158 columns, and 317 nonzeros.
    Presolve time =    0.00 sec.
    MIP emphasis: balance optimality and feasibility.
    MIP search method: dynamic search.
    Parallel mode: none, using 1 thread.
    Root relaxation solution time =  -0.00 sec.

            Nodes                                        Cuts/
      Node  Left    Objective  IInf  Best Integer    Best Node    ItCnt    Gap

    *    0    0      integral    0        0.0000        0.0000      20    0.00%


    As you can see the complete pre-processing is seen and the solution was almost instantaneous. But I still do not get anything after the solution as mentioned in my previous post.

    Thanks a lot. Your suggestions have helped me a lot.
    SD


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 8.  Re: Save Engine Log

    Posted 05/28/08 02:30 PM

    Originally posted by: SystemAdmin


    [Didier Vidal said:]

    I'm afraid I'm out of ideas...

    Just a last thing, that I couldn't test (I'm working on a mono-cpu computer today)

    The log part you displayed seems to be specific to parallel cplex.

    Have you set the CPLEX parameters to request a multi-thread optimization ? For instance :

    cplex.setParam(IloCplex.IntParam.Threads, 2);


    Didier.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 9.  Re: Save Engine Log

    Posted 05/29/08 07:44 AM

    Originally posted by: SystemAdmin


    [sdwow said:]


    I changed the MIPDisplay settings to 4 and that helped.
          cplex.setParam(IloCplex.IntParam.MIPDisplay,4);

    Thank you very much for your help. I am a beginner at OPL and learning my way around :)
    SD
    #DecisionOptimization
    #OPLusingCPLEXOptimizer