Skip to content

Commit

Permalink
enable multi-threading
Browse files Browse the repository at this point in the history
  • Loading branch information
h-yon committed Nov 12, 2021
1 parent 1769ca6 commit d999105
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cylp/cpp/ICbcModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include "CbcCompareUser.hpp"
#include "CbcSolver.hpp"
#include <string>
#include <thread>

PyObject* ICbcModel::getPrimalVariableSolution(){

Expand Down Expand Up @@ -31,10 +33,12 @@ int ICbcModel::cbcMain(){
// initialize
int returnCode = -1;
int logLevel = this->logLevel();
const char* argv[] = {"ICbcModel", "-solve","-quit"};
const char* argv[] = {"ICbcModel", "-threads",
std::to_string(std::max(std::thread::hardware_concurrency(), 1u)).c_str(),
"-solve", "-quit"};
CbcMain0(*this);
this->setLogLevel(logLevel);
return CbcMain1(3, argv, *this);
return CbcMain1(5, argv, *this);
//const char* argv = "-solve -quit";
//CbcSolverUsefulData solverData;
//CbcMain0(*this, solverData);
Expand Down

0 comments on commit d999105

Please sign in to comment.