Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Using barrier optimizer for non linear problems- Memory error

    Posted 05/08/12 12:26 PM

    Originally posted by: dparaskevop


    Dear all,

    I am using cplex callable libraries and c++ language under VStudio 2010, for solving a discrete optimization problem, with a non linear obj. function. I need to call multiple times baropt (barrier optimizer) within my code, and after a number of iterations e.g. 20-30 baropt runs I get a memory error which is down to cplex. Attached is the message I get fyi.

    Have you ever faced such problem? It is dead-end for me I have tried literally everything!

    Thank you so much for your consideration and time!

    Best regards,

    Dimitris
    #DecisionOptimization
    #MathematicalProgramming-General


  • 2.  Re: Using barrier optimizer for non linear problems- Memory error

    Posted 05/10/12 05:09 AM

    Originally posted by: SystemAdmin


    Is it possible that you are running out of memory?
    Can you monitor memory consumption in the task manager or some other tool? If the access violation occurs, are you close to the memory limit?
    If you are running out of memory:
    1. can you double check that your code has no memory leaks.
    2. can you check if the problem persists if you use only one thread?
    What version of CPLEX are you using?
    Do I understand correctly that your code is in C++ but you do not use the C++-Concert classes of CPLEX?
    #DecisionOptimization
    #MathematicalProgramming-General


  • 3.  Re: Using barrier optimizer for non linear problems- Memory error

    Posted 05/10/12 06:37 AM

    Originally posted by: dparaskevop


    Hi Daniel,

    Great thanks for your reply!!!

    > Is it possible that you are running out of memory? Can you monitor memory consumption in the task manager or some other tool? If the access violation occurs, are you close to the memory limit?

    I have the task manager open, while running, and when the access violation occurs, the algorithm has used up to 100 MB. My system has available 16GB of RAM. The weird thing is that there is memory leak. At each iteration there are about 10 MB that are added to the memory usage. And it is only by baropt there aren't any other functions or data structures created. The whole code is given below:

    #define ILO_MSVC
    #include <C:\ILOG\CPLEX121\include\ilcplex\cplex.h>

    #include <iostream>

    using namespace std;

    void main()
    {
    int status=0;
    CPXENVptr env;
    CPXLPptr lp;
    for(int u=0;u<1000;u++)
    {
    lp=NULL;
    env = CPXopenCPLEX (&status);
    lp = CPXcreateprob (env, &status, "model.lp");
    status = CPXsetintparam (env, CPX_PARAM_SCRIND, CPX_OFF);
    status = CPXreadcopyprob (env, lp, "model.lp", NULL);
    status = CPXbaropt (env, lp);
    status=CPXgetstat (env, lp);
    cout<<status<< " "<<endl;
    status = CPXfreeprob (env, &lp);
    status = CPXcloseCPLEX(&env);
    }
    }

    The model.lp is a particular problem that is fed at each iteration and solved by baropt. The same lp is solved for about 15 times and then the access violation occurs.

    >>2. can you check if the problem persists if you use only one thread?

    I am running it right now I 'll let you know.

    >>What version of CPLEX are you using?

    12.1. I am trying to install the 12.4 but the installation process sticks in the beginning...I am working on it.

    >>Do I understand correctly that your code is in C++ but you do not use the C++-Concert classes of CPLEX?

    Yes. But I have no experience in concert technology, should I use the concert classes then?

    All the very best!
    #DecisionOptimization
    #MathematicalProgramming-General


  • 4.  Re: Using barrier optimizer for non linear problems- Memory error

    Posted 05/10/12 03:08 PM

    Originally posted by: SystemAdmin


    > >>Do I understand correctly that your code is in C++ but you do not use the C++-Concert classes of CPLEX?
    >
    > Yes. But I have no experience in concert technology, should I use the concert classes then?
    >
    No, there is no need to do that. Using concert technology in the wrong way is a common way of implementing memory leaks. I just wanted to eliminate this possibility.
    #DecisionOptimization
    #MathematicalProgramming-General


  • 5.  Re: Using barrier optimizer for non linear problems- Memory error

    Posted 05/10/12 08:19 AM

    Originally posted by: dparaskevop


    Hi Daniel,

    It seems that by restricting the threads to one, the problem is resolved! Thank you so much for your help!

    Just for the record, is there any particular reason behind this?

    Great thx once again!

    Dimitris
    #DecisionOptimization
    #MathematicalProgramming-General


  • 6.  Re: Using barrier optimizer for non linear problems- Memory error

    Posted 05/10/12 03:11 PM

    Originally posted by: SystemAdmin


    > It seems that by restricting the threads to one, the problem is resolved! Thank you so much for your help!
    >
    > Just for the record, is there any particular reason behind this?
    >
    Yes. Older versions of CPLEX leaked memory when multi-threaded barrier was used. If you want to get back multi-threaded solves you can try to set environment variable MKL_DISABLE_FAST_MM to a non-empty value. Or just upgrade to 12.4. The memory leakage problems are fixed in that version.
    #DecisionOptimization
    #MathematicalProgramming-General


  • 7.  Re: Using barrier optimizer for non linear problems- Memory error

    Posted 05/10/12 06:34 PM

    Originally posted by: dparaskevop


    Thank you very much, Daniel. I should think of upgrading to the latest version.

    All the best!

    Dimitris
    #DecisionOptimization
    #MathematicalProgramming-General