Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Help for "Cplex Error 12: Unknown error code"

    Posted Mon December 09, 2013 06:53 AM

    Originally posted by: BiaoY


    Dear all,

    I use Microsoft Visual Studio 2008 and CPLEX_Studio_AcademicResearch122.

    The programme I wrote can solve VRP within 20 customers by Branch and Price.

     However, during solving 25 customers,  after more than 300 iterations, the programme noticed "Cplex Error 12: Unknown error code".

    I found the related topics in the Forum, But it seems no use.

    So how can I debug this error?

    Thank you!


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Help for "Cplex Error 12: Unknown error code"

    Posted Mon December 09, 2013 02:09 PM

    Version 12.2 is quite old. Is it an option to upgrade to something more recent, 12.5.1 for example?

    I think that "Error 12" was a bug in version 12.2 that has been fixed in one of the later versions.


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Help for "Cplex Error 12: Unknown error code"

    Posted Tue December 10, 2013 01:23 AM

    Originally posted by: BiaoY


    Hi, DanielJunglas

    Thanks for your help. But it still has some problems.

    In my programme, the "try-catch" is  

    try

    {

     ...

    }

    catch (IloException& e)
     {
      cerr << "Exception is " << e << endl;     //(1)
     }
     catch (...)
     {
      cerr << "Unknown ERROR! " << endl;  // (2)
     } 

    In version 12.2, the error is thrown by sentence (1), which is "Cplex Error 12: Unknown error code" .

    In version 12.5, the error is thrown by sentence (2), which displays "Unknown ERROR!". In the next iteration, the error is: "Cplex error 1001: Out of memory."

    Does any error with my codes? How can I deal with this problem?

    Thank you very much.


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Help for "Cplex Error 12: Unknown error code"

    Posted Tue December 10, 2013 01:39 AM

    First of all, you should figure out what that unknown error is. This sort of exception is not thrown by CPLEX. To figure this out I would first try to catch std::exception (this is in the <exception> header file) as well:

    catch (std::exception &e) {
       cerr << "std::exception: " << e.what() << endl;
    }
    catch (...)

    If that does does not help you will have to use a debugger to figure what sort of exception that is. It would also be helpful to figure out where exactly this exception is thrown.

    The "Cplex error 1001: Out of memory" may have to reasons:

    1. Your model is just too big. Since you seem to be able to solve it several times in an iterative algorithm my guess is that
    2. you are leaking memory. Double check that at the end of each iteration you properly end() everything that is no longer needed. If possible call env.end() and use a new instance of IloEnv for each iteration, that is the safest thing to do but is not always possible to do.

    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Help for "Cplex Error 12: Unknown error code"

    Posted Tue December 10, 2013 02:37 AM

    Originally posted by: BiaoY


    Thank you very much. DanielJunglas .

    The above problem is solved according to your suggestions.

    However, I still have a problem which troubles me for a long time.

     How to debug in Microsoft Visual Studio 2008 when using cplex ?

    According to my test, the breakpoints cannot be used when the configuration is setted "release". So how to debug with the release configuration?

    Thank you very much again !


    #CPLEXOptimizers
    #DecisionOptimization