Multiple threads in Cbc via C interface
Dear Cbc enthusiasts,
currently I am solving a mixed-integer linear program using Cbc via the C interface in Cbc_C_Interface.h.
This works well, but I observe that Cbc uses only one thread regardless of the setting provided with Cbc_setParameter() and name=INT_PARAM_THREADS.
In contrast, storing the model in an lp file and running it in the Cbc executable, which was complied from the same Cbc source, invokes multiple threads in the solver. Is there something else I need to adjust via the C interface in order to run the parallel version?
In older versions (e.g. 2.10.x or older) of Cbc there is no function Cbc_setParameter() available in Cbc_C_Interface.h. How can I use multiple threads in the Cbc solver then?
Thanks a lot for your help in advance!
In the mean time, I noticed that on branch "master" the problem was fixed by commit Cbc_C_Interface::synchronizeParams (f25c45d) provided by Samuel S. Brito.
It would be very helpful to backport this change also to other (older) stable branches of Cbc, e.g. the branch "stable/2.10".
That particular fix is not relevant to stable/2.10. It was made specifically to address bugs introduced in the refactoring that is currently being done in master. The issue must be something unrelated. I have the feeling that you may not be setting parameters correctly, so it would help if you could just post a minimal example of code that fails. Hopefully, @samuelsbrito can have a look at it.
Actually, it doesn't look like the interface in stable/2.10 is really completely functional. I think the development is mainly happening in master at this point, since that is what python-mip depends on. But @h-g-s or @samuelsbrito may be able to say more.
Yes, I agree, it seems that the interface in stable/2.10 does not support multiple threads via the C interface. Are there other options besides using files and the command line to run Cbc in parallel?
For my current problem it seems that the version on the stable/2.10 branch performs somewhat better than the one on the master branch.
Is it worthwhile backporting the new C interface to the stable versions? What needs to be done for this? Which files are affected?
@h-g-s @samuelsbrito: Could you please give me a hint?