Decision Optimization

 View Only
  • 1.  CPLEX ClearModel() vs EndModel()

    Posted Tue October 05, 2021 07:12 AM
    I have a very large model with 10-15M of variables and 10-15M of constraints and I need to run few iterations with some minimal changes in the model. I cache old variables and constraints so I can use in the next iteration. After each iteration finish I used to clear model by Cplex.ClearModel() function, but Cplex.ClearModel() has performance penalty in term of time taken So I want to use Cplex.EndModel(). But in some instances, in the next iteration Cplex throwing below errors when i use Cplex.EndModel() and application is terminated immediately.

    "System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.' "
    "Description: The process was terminated due to an unhandled exception. Exception Info: System.AccessViolationException"

    I use Cplex 12.6 .NET Conert technology.

    Is there any way i can use Cplex.EndModel() to clear my model objects instead of Cplex.ClearModel() as it is taking few minutes which i can't afford.

    I found below document in IBM site:


    ------------------------------
    ORE2021
    ------------------------------

    #DecisionOptimization


  • 2.  RE: CPLEX ClearModel() vs EndModel()

    Posted Thu October 14, 2021 05:44 AM
    You have to upgrade your CPLEX Studio version: 12.6 is so old and not supported anymore.
    Many bug fixes went into the releases: there may very well be a bug in the .NET for 12.6.x release.

    ------------------------------
    Vincent Beraudier
    ------------------------------



  • 3.  RE: CPLEX ClearModel() vs EndModel()

    Posted Fri October 15, 2021 04:35 AM
    Note that EndModel is ending all the CPLEX content, that is also the variables.

    ------------------------------
    Vincent Beraudier
    ------------------------------