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

Adding Cbc threading support #1

Closed
kellrott opened this issue May 2, 2013 · 1 comment
Closed

Adding Cbc threading support #1

kellrott opened this issue May 2, 2013 · 1 comment

Comments

@kellrott
Copy link

kellrott commented May 2, 2013

Adding methods to the CbcModel to access the getNumberThreads and setNumberThreads calls will enable users to perform parallel calculations:

diff --git a/cy/CyCbcModel.pxd b/cy/CyCbcModel.pxd
index a2ee7f1..9209789 100644
--- a/cy/CyCbcModel.pxd
+++ b/cy/CyCbcModel.pxd
@@ -56,6 +56,9 @@ cdef extern from "ICbcModel.hpp":
         bint setMaximumNodes(int value)
         int getMaximumNodes()

+        int getNumberThreads()
+        void setNumberThreads(int value)
+
         void setLogLevel(int value)
         int logLevel()

diff --git a/cy/CyCbcModel.pyx b/cy/CyCbcModel.pyx
index 16943cc..159d5d9 100644
--- a/cy/CyCbcModel.pyx
+++ b/cy/CyCbcModel.pyx
@@ -209,4 +209,13 @@ cdef class CyCbcModel:

         def __set__(self, value):
            self.CppSelf.setMaximumNodes(value)
+
+    property numberThreads:
+        def __get__(self):
+            return self.CppSelf.getNumberThreads()
+
+        def __set__(self, value):
+            self.CppSelf.setNumberThreads(value)
+
+
     #TODO: add access to solver: getLower, getUpper,...
@mpy
Copy link
Contributor

mpy commented May 2, 2013

Done! Thank you so much for your feedback.

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