Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

Callbacks and multi-threads, CPLEX 12.7.0 vs 12.6.2

  • 1.  Callbacks and multi-threads, CPLEX 12.7.0 vs 12.6.2

    Posted Sun February 12, 2017 03:23 PM

    Originally posted by: A.Florio


    Hi,

     

    I'm observing an inconsistent and undocumented (?) behaviour across CPLEX versions.

     

    Context:

    I have a mixed-integer model implemented in CPLEX 12.7.0. There are a number of callbacks: lazy constraints, user cuts, incumbent, branch... I'm using the opportunistic parallel optimiser with 4 threads. All the callbacks communicate via a single shared object. This object implements all the necessary access controls (mutexes) to prevent data races.

     

    Problem:

    One of the callbacks performs a local search on some saved solution. This operation takes a while (several seconds, maybe 1-2 minutes). I noticed that while this operation was in progress the other threads seemed to be idle. My first suspicion was that some mutex was active, preventing the other threads from progressing. However this was not the case, since all mutexes are released when the local search starts. Once the local search routine finishes (and the callback returns), I see all the threads active again (the callbacks are output intensive, and I can also see in the activity monitor of the operating system).

    It seems CPLEX is placing all other threads on hold while the thread executing the callback with the local search is running. Before I started to try to prove this point, I decided to test the same code in an older version (12.6.2). To my surprise, behaviour now was normal. I could see all the threads executing the callbacks (and outputting) while the local search was in progress.

     

    Note that when using 12.7.0 I'm compiling with libc++ and when using 12.6.2 with libstdc++. Using MacOS in both cases.

     

    So I'll revert to 12.6.2 for now (the other option would imply creating a new thread from the callback and detaching it, so the callback could return and unlock the other threads), but I thought maybe there is something else I should know.

     

    Alexandre

     

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Callbacks and multi-threads, CPLEX 12.7.0 vs 12.6.2

    Posted Tue February 14, 2017 02:11 AM

    Thanks a lot for this very detailed report that made it easy to reproduce the behavior here.

    I'm afraid you did not overlook something. This is a bug that crept into version 12.7. Unfortunately, there is no workaround, so the best thing you can do is indeed switch back to an older version for now.

    We are working on a fix for the next release of CPLEX.


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Callbacks and multi-threads, CPLEX 12.7.0 vs 12.6.2

    Posted Tue February 14, 2017 03:51 AM

    Originally posted by: A.Florio


    Ok, thanks for the quick reply!

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Callbacks and multi-threads, CPLEX 12.7.0 vs 12.6.2

    Posted Mon June 12, 2017 11:43 AM

    This problem was fixed in version 12.7.1.


    #CPLEXOptimizers
    #DecisionOptimization