Forum Discussion
FICO
3 years agoCommunity Manager
new XPRM() initialization error in multi-threaded Java programs
Hi, I wrote a multi-threaded Java program to run a large number of small MIP problems. Occasionally, the XPRM() initialization fails at this line: XPRM xprm = new XPRM(); When I print the error sta...
FICO
3 years agoCommunity Manager
Hi Jie,
Is it be possible for you to upgrade to the latest Xpress version: 9.0.0 ?
Could you try to run your application on Linux (e.g. in a VM or Docker) or on Mac, to see if the problem reproduces on a different OS?
Which version of Java are you using and from which vendor (Amazon, ...)?
This sounds like a race condition and could also be a memory corruption that is caused by a race condition. Since there are problems with the initialization of the standard output streams, this could also be an issue related to Windows. It would be interesting to see whether the problem exclusively happens on Windows or whether it also reproduces on Linux or macOS. In the past, I have observed problems with initialization of the standard output streams on Windows when we tried to load the Python library into the Mosel process. At that point in time, Mosel and Python were using different versions of the Microsoft C compiler, and Windows basically didn't support applications that loaded libraries into the same process that had been compiled with those two different versions of the C compiler; and the error message we got was that the standard output stream couldn't be initializes sometimes (e.g. in one of 100 cases). However, those kind of issues should be very rare. I'm just mentioning it for the sake of completeness, and to give you an understanding why I think that it could help to know whether this problem only occurs on Windows, or whether it also reproduces on Linux or Mac.
If it's a race condition that is caused by an issue in Xpress or Mosel, then it would be helpful if you could share at least the source of the Mosel model, the code that calls the Mosel model, and an example input for the model. Race conditions are hard to reproduce, and if we have to try to reproduce it on our side, without having much source code from your side, it might be difficult to reproduce the problem on our side. However, if it's not possible for you to provide more code, I can just write a stress test for XPRM init and see whether that's enough to reproduce the issue.
Regards,
Johannes