-
Notifications
You must be signed in to change notification settings - Fork 16
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
Cgl012cut.cpp is not threadsafe #63
Comments
Looks to me like it is intentional that the variable is global. I guess it would be algorithmically valid to make it a field in the sense that the value it gets will be valid, just maybe not "as good" as the value it would get it if it were global. One of the limitations of the modular design of Cgl is that it's not easy to maintain this kind of global information, but I'm not sure how best to modify this. Interestingly, there is a commit back in 2014 to "make zerohalf threadsafe" 2b40662. Maybe @jjforrest can comment. |
As parallel cbc is normally non-deterministic, this does not matter
bug-wise as it just means cuts may or may not get generated (but they
will be valid ones).
But it would be tidier - I don't know who knows about internals of
Cgl012Cut - but it is quite likely that I was last person to modify it -
so I can modify code if nobody else volunteers.
John Forrest
…On 13/05/2021 15:14, tosttost wrote:
In Cgl012cut.cpp line 3289:
|static double max_score_ever = ZERO; /* maximum score of a violated cut
during the whole cutting plane procedure */ |
this global variable is used and updated during separation, so multiple
instances of Cgl012cut running in parallel (or probably sequential
within the same process) will influence each other.
Note that I have no idea if
* what effects this might have on Cbc
* it is algorithmically valid to turn that global variable into a
field of Cgl012cut (which would be easy to do)
Is there anyone around that knows about the internals of Cgl012cut?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#63>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABWJYHGSLPNBPH3IRK5EDOTTNPNCRANCNFSM442UCWDA>.
|
Thanks for the explanation. If only less cuts but no invalid cuts are separated, the severity of this issue is reduced significantly. It might be an exotic use case but there are definitely people who use cbc as a library to solve multiple MIP within the same process. Writing problems into files and calling the cbc executable is not always viable:
Therefore thread safety is not only relevant in terms of "./cbc foobar.mps -threads 42 -solve". Mutable global variables are not reset. Therefore even if the problems are solved sequentially within the same process they will influence each other. |
In Cgl012cut.cpp line 3289:
this global variable is used and updated during separation, so multiple instances of Cgl012cut running in parallel (or probably sequential within the same process) will influence each other.
Note that I have no idea if
Is there anyone around that knows about the internals of Cgl012cut?
The text was updated successfully, but these errors were encountered: