Skip to content
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

Call concurrent solver if available, to leverage multiple CPU cores #43

Open
yonch opened this issue Mar 23, 2023 · 1 comment
Open

Comments

@yonch
Copy link
Contributor

yonch commented Mar 23, 2023

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.

@mmghannam
Copy link
Member

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants