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