Forum Discussion
FICO
3 years agoCommunity Manager
Rare occurrences of exception xpress.InterfaceError: Incorrect control name
We have an optimization job that ~2% of the time fails with xpress.InterfaceError: Incorrect control name when trying to set xp.controls.miprelstop. This is the first line of code in our solver function (we are using Python and the FICO Python interface via import xpress as xp). Could we avoid this error by calling with xp.init(): as the first line in the function to initialize the environment? Not sure if it's relevant but we are using a floating license and have our xpauth.xpr file saved locally to the instance where our job is being run.
3 Replies
- FICOCommunity Manager
Could it be that in those 2% of the cases in which setting miprelstop fails the license is not available? In order to set a control without having an xpress.problem instance a license is required since otherwise the Xpress API cannot check whether the control you are setting actually exists.
Since you are modifying controls before creating an xpress.problem instance, it is indeed recommended that you explicitly call xprs.init() before doing that (it is recommended to do this using a context manager, see the documentation of that function).
In general, is it important that you set these controls globally? Unless you are creating many xpress.problem instances in different places and all instances need this setting, I think it would be better to change the control values on the xpress.problem instances:
with xp.problem() as p: p.controls.miprelstop = 0.01 - FICOCommunity Manager
That makes sense, we have a wrapper that attempts to catch a "Xpress licensing error 4" message, but sounds like a no license available error could manifest differently if the first thing we try to do is set this control parameter. We've made a change to put our modeling code within a `with xp.init():` context.
- FICOCommunity Manager
I confirm that in this particular case a missing license will manifest as "incorrect control name". I have filed a bug report to get this fixed.
Related Content
Related Content
xpress.InterfaceError: Incorrect control name error
I upgraded FICO Xpress Optimization from version 8.8.0 to 8.9.3. The following used to work in the python3 interface of version 8.8.0: import xpress as xp xp.controls.outputlog = 0 # disable all s...6 years agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum2 unread comments2 unread1View0likes2CommentsHow to resolve traceback: "xpress.InterfaceError: Incorrect control name; check name and license type"?
We are trying to access xpress in Python via Pyomo. We have no issues installing xpress and solving a simple model with the xpress interface. However, when we attempt to access xpress via pyomo we re...2 years agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum1 unread comment1 unread1View0likes1CommentException Thrown: 'System.BadImageFormatException' in xprsdn.dll
I am trying to use XPRESS optimizer using C# using Visual Studio. I found an example which I am trying to run. The code is given below. using System; using System.IO; using Optimizer; namespace X...4 years agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum1 unread comment1 unread0Views0likes1Comment