Topic
  • 10 replies
  • Latest Post - ‏2013-01-11T07:48:48Z by Michael_D
Michael_D
Michael_D
41 Posts

Pinned topic BranchCallback issue after upgrading to 12.4

‏2012-08-16T14:19:59Z |
In a Concert C++ project in Visual Studio 2010, after upgrading from version 12.2 to 12.4, the program crashes in the main() function of the branch callback after a few seconds, but not necessarily when the code is reached for the first time (depending on the problem instance):




int NumBranches = getNbranches(); 

if (NumBranches == 2) 
{ 

for (

int i = 0; i < NumBranches; ++i) 
{ IloNumVarArray vars(getEnv()); IloNumArray bounds(getEnv()); IloCplex::BranchDirectionArray dirs(getEnv()); getBranch(vars, bounds, dirs, i);


When execution enters getBranch(), it reaches the line




return doGetBranch(vars, bounds, dirs, i);


in ilocplexi.h. Then, there is no further source code. The call stack window says that IloBranchCallbackManager::getBranch() + 0xd5 bytes is entered and then IloNumExpr::IloNumExpr(const std::num_get<char,std::istreambuf_iterator<char,std::char_traits<char> > > & expr) Line 284.

The following message appears:

Unhandled exception at 0x0000000140622b96 in MyProg.exe: 0xC0000005: Access violation reading location 0xffffffffffffffff

The code uses a cut callback in which cuts (real cuts, no lazy constraints) are added with add(). After switching to 12.4, this cut callback is now derived from IloCplex::UserCutCallbackI, whereas before, it was derived from IloCplex::CutCallbackI. When the line where the cuts are added is removed (that is, when no cuts are added), the above crash does not occur (in the first few minutes).

With 12.2, the code ran on three different computers for hundreds of CPU hours and millions of calls to this branch callback. What could be the problem here?
Updated on 2013-01-11T07:48:48Z at 2013-01-11T07:48:48Z by Michael_D
  • Michael_D
    Michael_D
    41 Posts

    Re: BranchCallback issue after upgrading to 12.4

    ‏2012-08-27T18:43:26Z  
    Hello everybody,

    10 days and no reply - what's wrong with this post? The issue is still unresolved...
  • SystemAdmin
    SystemAdmin
    7929 Posts

    Re: BranchCallback issue after upgrading to 12.4

    ‏2012-08-31T16:26:59Z  
    Your code looks correct to me.
    Does it help to disable presolve?
    Does your code use any non-linear constraints like min, max, or, abs, piecewise linear?
  • SystemAdmin
    SystemAdmin
    7929 Posts

    Re: BranchCallback issue after upgrading to 12.4

    ‏2012-08-31T16:29:58Z  
    • Michael_D
    • ‏2012-08-27T18:43:26Z
    Hello everybody,

    10 days and no reply - what's wrong with this post? The issue is still unresolved...
    Please note that people contribute to this Forum when they find the time to do so. Sometimes people are on vacation, sometimes they are on a work-related trip. Sometimes they just don't find the time. There is no guarantee that your questions will be answered (or will be answered in a short time).
    If you need guaranteed response times then you might consider to contact the official support team (which would require holding a commercial CPLEX license).
  • SystemAdmin
    SystemAdmin
    7929 Posts

    Re: BranchCallback issue after upgrading to 12.4

    ‏2012-09-18T07:14:06Z  
    Your code looks correct to me.
    Does it help to disable presolve?
    Does your code use any non-linear constraints like min, max, or, abs, piecewise linear?
    Just to repeat what Daniel said: the issue could be related to a new presolve reduction that we have added to CPLEX 12.3. This is the reason why Daniel asked whether disabling presolve would fix the issue for you. If not, we need to investigate further.

    Tobias
  • Michael_D
    Michael_D
    41 Posts

    Re: BranchCallback issue after upgrading to 12.4

    ‏2012-09-27T08:53:38Z  
    Please note that people contribute to this Forum when they find the time to do so. Sometimes people are on vacation, sometimes they are on a work-related trip. Sometimes they just don't find the time. There is no guarantee that your questions will be answered (or will be answered in a short time).
    If you need guaranteed response times then you might consider to contact the official support team (which would require holding a commercial CPLEX license).
    Daniel, don't get me wrong. My self-reply above was not a complaint. I am well aware that, as an academic user, I use Cplex and this support forum for free. I have benefitted a lot from the forum in the past, and I keep telling everybody about the great job you and the other contributors are doing. I just wasn't used to not getting a reply for so long, so I suspected that the post had simply been overlooked and gone down the list too far.
  • Michael_D
    Michael_D
    41 Posts

    Re: BranchCallback issue after upgrading to 12.4

    ‏2012-09-27T08:58:50Z  
    Just to repeat what Daniel said: the issue could be related to a new presolve reduction that we have added to CPLEX 12.3. This is the reason why Daniel asked whether disabling presolve would fix the issue for you. If not, we need to investigate further.

    Tobias
    Meanwhile, I finished the project with version 12.2. After re-switching to 12.4, when trying out your proposal to turn off presolve (by setting
    MyCplex.setParam(IloCplex::PreInd, 0);
    
    ), the problem persists. There are no nonlinear constraints of any kind.
    Updated on 2014-03-24T22:51:28Z at 2014-03-24T22:51:28Z by iron-man
  • SystemAdmin
    SystemAdmin
    7929 Posts

    Re: BranchCallback issue after upgrading to 12.4

    ‏2012-10-01T14:08:16Z  
    • Michael_D
    • ‏2012-09-27T08:53:38Z
    Daniel, don't get me wrong. My self-reply above was not a complaint. I am well aware that, as an academic user, I use Cplex and this support forum for free. I have benefitted a lot from the forum in the past, and I keep telling everybody about the great job you and the other contributors are doing. I just wasn't used to not getting a reply for so long, so I suspected that the post had simply been overlooked and gone down the list too far.
    OK, we are on the same page then.
    Unfortunately, you are right: sometimes things do get overlooked :-(
  • SystemAdmin
    SystemAdmin
    7929 Posts

    Re: BranchCallback issue after upgrading to 12.4

    ‏2012-10-01T14:12:23Z  
    • Michael_D
    • ‏2012-09-27T08:58:50Z
    Meanwhile, I finished the project with version 12.2. After re-switching to 12.4, when trying out your proposal to turn off presolve (by setting <pre class="java dw" data-editor-lang="java" data-pbcklang="java" dir="ltr">MyCplex.setParam(IloCplex::PreInd, 0); </pre> ), the problem persists. There are no nonlinear constraints of any kind.
    OK, I don't have more ideas what could be wrong.
    Is it possible to create a small example that reproduces the issue? Or does the issue only occur in a complex setup?
  • SystemAdmin
    SystemAdmin
    7929 Posts

    Re: BranchCallback issue after upgrading to 12.4

    ‏2012-10-01T14:17:55Z  
    OK, I don't have more ideas what could be wrong.
    Is it possible to create a small example that reproduces the issue? Or does the issue only occur in a complex setup?
    It could be helpful if you could export your Concert model to an XML file using IloXmlContext right before invoking solve() and post that model here or send it to me daniel(dot)junglas(at)de(dot)ibm(dot)com.
    And yet another question: What does the getBranchType() function return before you call getBranch()?
  • Michael_D
    Michael_D
    41 Posts

    Re: BranchCallback issue after upgrading to 12.4

    ‏2013-01-11T07:48:48Z  
    It could be helpful if you could export your Concert model to an XML file using IloXmlContext right before invoking solve() and post that model here or send it to me daniel(dot)junglas(at)de(dot)ibm(dot)com.
    And yet another question: What does the getBranchType() function return before you call getBranch()?
    Just in case somebody is interested how this story ended:

    Daniel proposed to set a hidden parameter to false:

    cplex.setParam(IloCplex::BoolParam(2100), false);
    


    This resolved the issue.
    Updated on 2014-03-24T22:42:15Z at 2014-03-24T22:42:15Z by iron-man