-
Notifications
You must be signed in to change notification settings - Fork 117
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
Option '-threads 8' causes unpredictable hanging due to lock issue #640
Comments
I did some further tests. It seems, that Python-Mip is not facing this problem. Mip uses obviously |
I replaced the cbc.exe with the one from here: https://github.com/FranksMathematics/CBC_ReleaseParallel_Win86 Now it works and is really fast. Could it be a good idea to make a new pre-compiled binary with parallel optimization also for the binary downloads on coin-or? Today all computers have at least 4 cores with 8 threads, so parallelisation should be available. |
Can you upload the mps file for testing? |
The file is quite large, therefore I added the code to generate the file at coin-or/pulp#737 (several of the files generated here hang, so I don't think it's a problem of the actual program to solve). I compressed it and attached it here: Nevertheless, it's just a toy example I di let generate by GPT4, because I wanted to check something. |
Thanks. I'll try the mps with the master build of the Windows build of cbc. |
I probably experienced this with version 2.10.8 (Debian 12 docker image). However, it happens very rarely and is incredibly hard to reproduce. I could not reproduce it with the example provided. Probably unrelated, but once I got this error message:
The solver didn't crash after the error message, it just froze. But I also experienced hanging without an error message. I'm using the Rust bindings, so I can't be 100% sure it's related to Coin CBC itself, but I do think so. |
With current master and my build, if I add
Also when run 10 times in a loop. |
I also ran the latest stable Cbc 2.10.11 (x64) on Windows for 100 times with the given command (plus -solve) and the MPS file without any issues. Given that this can't be reproduced with current Master and not with current Stable (2.10.11), I would propose to conclude that whatever the underlying root cause once was, it's fixed now. |
where can I get the latest Cbc as Windows binary? To check if it works. |
Latest stable or latest master branch? The latest stable build is available via Releases. Unfortunately, I believe the published Windows binaries are not built with multithreading support. So not good for you. The latest master build (aka nightly / trunk / unstable) is To build for Windows with parallel / multithreading, see building CBC with Visual Studio. For my test with Cbc 2.10.11 (above), I built with multithreading support via Visual Studio using pthread-win32. |
I opened an issue on Python Pulp on this but they told it is related to CBC - see coin-or/pulp#737
From Python-Pulp this is called
C:\Python312\Lib\site-packages\pulp\solverdir\cbc\win\64\cbc.exe C:\Users\Michael\AppData\Local\Temp\9f2f4340f4914ba58ec92a8628688845-pulp.mps -threads 8 -timeMode elapsed -branch -printingOptions all -solution C:\Users\Michael\AppData\Local\Temp\9f2f4340f4914ba58ec92a8628688845-pulp.sol
The mps file is produced from the code depicted at coin-or/pulp#737.
I can run this sometimes only once, sometimes 10 times but eventually it hangs with this output:
The text was updated successfully, but these errors were encountered: