scipopt/russcip

Call concurrent solver if available, to leverage multiple CPU cores

yonch opened this issue · 1 comments

yonch commented

The SCIP solver supports concurrent solving, through the use of SCIPsolveConcurrent(). Note that SCIPsolveParallel is mentioned in the docs about how to run concurrent solving for version 4.0, but is marked as deprecated in favor of SCIPsolveConcurrent in the code.

For example, it is possible to build SCIP with multi-threading support on macOS, by setting TPI=tny.

However SCIPsolveConcurrent() fails when SCIP is built without parallel support rather than calling the single-threaded code.

To correctly call the suitable method for the build, there is a SCIPtpiGetNumThreads() method in tpi.h, that returns 1 when no threading support is available. So we could check if the return value is 1 and call the single threaded solve, otherwise call SCIPsolveConcurrent().

I'll include a PR, however I have little experience with bindgen and it appears SCIPtpiGetNumThreads() does not currently have ffi bindings.. Any idea how to add that?

cc @mmghannam if you might know.

@yonch I added an issue in scip-sys to include this and other functions for SCIP's parallel interface, I included an idea in the issue of how to fix this, if you're interested to work on it I'd be happy to review the change.