Forum Discussion
FICO
9 months agoCommunity Manager
Are preintsol callbacks threadsafe?
The optimizer documentation states "When the MIP callbacks are called they are MUTEX protected to allow non threadsafe user callbacks." In my Java code for one-tree Benders, if I specify a single thr...
FICO
9 months agoCommunity Manager
Callbacks are in general thread safe. The error message suggests that you are using the wrong problem reference when interacting with Xpress during a callback.
When interacting with Xpress during a callback, you should use the problem reference that is passed into the callback. The error message you are seeing suggests that you are instead using the global problem instance, i.e., the one on which you called optimize.
The problem reference passed into a callback is a thread-local problem reference. As long as you only use that reference in the callback, your callback is thread-safe with respect to Xpress.
Your single-threaded code works because with only one thread, the problem reference passed into the callback is the global problem.
Related Content
Related Content
How to make cuts added in a preIntsol callback globally valid (root node) instead of local to the current subtree?
I'm using the Xpress Optimizer Java API (com.dashoptimization, Xpress 9.4) to solve a MIP with lazy constraints that are generated dynamically. My constraints are all globally valid — they are not lo...2 months agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum2 unread comments2 unread3Views0likes2CommentsVariable names in callback (Java API)
I construct a cut in a preintsol callback using variables from the model containing the callback. When constructing the model, I give the variables names (using withName(...)) and store them in a vec...9 months agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum4 unread comments4 unread1View0likes4CommentsVariable object mapping issue in Python Callbacks with Presolve enabled
Hi, I am implementing a Branch-and-Cut algorithm using the Xpress Python interface. I have structured my code as a class where I create variables (using xp.var) and store them in a dictionary attrib...8 months agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum6 unread comments6 unread0Views0likes6Comments