Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Real time reported by CPLEX is different from clock time

    Posted 09/27/18 10:48 PM

    Originally posted by: rsbeigi


    I am using CPLEX 12.8  lazy constraint callback to solve a mixed integer linear program (coded in C++ Concert Technology, run in Ubuntu 18.04). I set a time limit of 10hrs for CPLEX and limit the number of threads used by CPLEX to one. I capture the solution time through the following code:

     

    tic = clock () ;
    cplex.solve() ;
    toc = clock() - tic ;
    TIME = (double) toc /CLOCKS_PER_SEC ;

     

    The solution time given by this code is 35,400 seconds while CPLEX terminates by reporting the 'Real time' of 36,000 seconds. Could you please explain why is this happeing? I have tested several instances and it is the case for them as well.

     

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Real time reported by CPLEX is different from clock time

    Posted 09/28/18 12:25 AM

    clock() measures CPU time while CPLEX by default measures wallclock time (as returned by gettimeofday()). So differences are expected.

    Also, the solve() function has some overhead in C++ that is not accounted for in the time that CPLEX reports. This overhead however should usually be negligible, but it makes it hard to get exact same numbers.


    #CPLEXOptimizers
    #DecisionOptimization