-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Julia binaries of HiGHS hang after solving a simple LP on Windows #1044
Comments
I've just downloaded the v1.4.0 Windows binaries, and reproduced the errant behaviour: occasional "hanging" after HiGHS has solved the problem (forrest6). Yet I don't get it for (say) v1.2.1 I can't recreate it with a local build of HiGHS v1.4.0, which is unfortunate, as debugging via creation of the binaries is not possible. |
I experienced the same. |
Thanks: that its behaviour varies from one Windows variant to another seems only to add to the difficulty of tracking down what's happening. For the other user I've suggested to use the driver https://github.com/ERGO-Code/HiGHS/blob/master/app/RunHighs.cpp to create a local version of the command-line executable. It would have to be compiled, and then linked to the static library that comes with the executable that's failing to terminate. However, others are using the static library successfully to call HiGHS from their own C++ code. Another work-around is to build HiGHS from source locally. Once CMake and the C++ compiler are set up properly, this works fine. Finally, for the Python-oriented, HiGHS is in PyPI so HiGHS can be run using pip install highspy and then writing a Python driver. Note that it may be necessary to update "pip", and even "python" |
It seems to me that there is definitely something hanging highs to not terminate. |
Hello there! I had the same issue with the static executable for Windows but the one with shared libraries worked fine. |
Thanks for your observations @pjaborges and @guifcoelho. The last "action" in When This isn't going to be fixed in the short term, so the best advice for Windows users for whom HiGHS hangs in this way is to create their own executable by compiling and linking |
Comments on #1137 give hope of fixing this |
I also stumbled over this in HiGHS 1.4.2.
I started Highs as an external process within a C# applicatoin. Sometimes the process would not exit.
|
Oh dear @jannicklange, I'm sorry you've had to do something so ugly. Can you not set threads=1 and prevent this? I think we're going to have to set something like threads=4 by default, and modify it internally if it (or the value set by a user) exceeds half the threads available |
Hello,
I am using Windows 11. I can provide an example if need be. |
Thanks, but it's easy to reproduce. We just haven't got around to identifying an internal fix. Just set 'threads=1' |
@jhay778 just encountered this working on OpenSolver. The fix of setting They were using https://github.com/JuliaBinaryWrappers/HiGHSstatic_jll.jl/releases/tag/HiGHSstatic-v1.6.0%2B0 |
Running highs.exe and observing in Process Monitor, seems that 9 threads are opened and only 2 are closed. Setting threads = 1 bypasses the issue for me. |
Thanks, this is useful information in addressing this issue |
@jhay778 (I know it was a while ago, so if you can remember) did you set threads via the command line, or via the parameters file? I tried the command line and get a “no such parameter” error. PS This is still happening, v1.7.1 highs.exe on Win11. I hope to post more data once I've investigated more. |
No, threads cannot be set as a command line parameter, only in a file https://ergo-code.github.io/HiGHS/stable/executable/#Command-line-options |
@jajhall here are my observations, perhaps they'll help, but I understand that Windows is not your typical environment, so it's hard to solve issues you don't even observe. The issue occurs on very simple LP problems, infrequently. In my stress test, it usually hangs just after 100s of iterations (adding a sleep between calls doesn't seem to help, as the issue linked in this discussion suggested). Here's the MPS I used in stress testing:
It seems to only require presolve, here's the log (the “failed” iteration, I can't see any difference from the “good” ones):
Setting Also, on my desktop PC with 12 physical CPU cores (24 max threads) only PS In all of the above I'm using highs.exe, I switched to it from calling the DLL from C# after not being able to resolve #1547 (comment). HiGHS instability on Windows is a concern, to be honest, but so far we've been able to find workarounds, and your advice is always highly appreciated. PPS Have you considered adding timestamps to each .log line? It's not a big deal, but would help seeing when the last log entry was updated, plus relative timings between lines. For appended logs it would help identify individual runs (including date). |
Thank you for the observations and comments, I will try again to dig in further into this one. You are right in saying that HiGHS instability on Windows is a concern |
@galabovaa Thank you for agreeing that this is a real concern. The problem of the process hanging is becoming increasingly disruptive for us, as it started to affect our customers. I'll try to introduce our own measures, e.g. attempt to kill the process after it saves a solution (ugh!), but an update from you would be highly appreciated if you had an opportunity to investigate this. |
Setting the HiGHS option threads=1 appears to prevent it from hanging, and has minimal impact on performance. |
@jajhall performance drops by ≈30% for me, not negligible. But you are right, it seems to be the price to pay for stability. I just keep hoping that this is a temporary “solution”. |
Solving a MIP? |
LP |
Ah, with parallel simplex. I assume that people aren't using that. If you're solving one-off LPs - or not hot starting after modifications - the interior point solver may well be faster. Have you tried it? |
@jajhall just tried ipm again (thanks for the reminder, I didn't check it for a long time!), it's more than x2 slower than parallel simplex with threads=1 (and x3 slower than parallel simplex with threads=0, sigh). PS Btw, parallel simplex with threads=1 is still about 10% faster than serial simplex, so I plan to continue using it, even if you think it's an unpopular option. |
You've got an interesting model there, particularly as parallel simplex with
All this uses the default dual simplex concurrency of 8. This may not be the best for your problems. You can experiment by lowering this value by setting (for example) Larger values for dual simplex concurrency are unlikely to give better performance, so it's not possible to set Would you be able to share a typical model with me somehow? |
Thank you for your advice! Setting In general, even if it worked, I don't think I can trust results from just one hardware. I don't have control over customer systems and can't tailor stress-tested custom configs for each one. E.g. see my feedback from earlier tests, “…on my desktop PC with 12 physical CPU cores (24 max threads) only threads=1 helps. But on my laptop with 8 cores (16 threads) it looks like threads=2 is stable.” (I meant that 1 is stable, but 2 is stable also) Even with Hard to say what's a typical model, but here's an example of a “slow” MPS I use for performance tests: 63593-slow.zip. My timings:
Thanks again for your quick responses and for looking into this. |
Thanks for this. The IPM solver fails after 800s, so reverts to serial simplex - which solves the problem in a further 775s Vanilla dual simplex takes 745s Dual simplex with concurrency/threads of 4 takes 516s It'll be an interesting test for our new IPM solver |
Closed by #1942 |
@jajhall @galabovaa my tests so far confirm that this issue is fixed in 1.8.0, thank you! |
Great: thanks for letting us know! |
No description provided.
The text was updated successfully, but these errors were encountered: