Changeset 1820 for stable


Ignore:
Timestamp:
Nov 29, 2012 8:28:09 AM (6 years ago)
Author:
stefan
Message:

sync with trunk rev 1819

Location:
stable/2.8/Cbc
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • stable/2.8/Cbc

  • stable/2.8/Cbc/src/CbcHeuristicLocal.cpp

    r1802 r1820  
    10671067
    10681068  numCouldRun_++;
     1069  if (!model_->bestSolution())
     1070    return 0; // odd - because in parallel mode
    10691071  int nodeCount = model_->getNodeCount();
    10701072  if (numberSolutions_ == model_->getSolutionCount())
  • stable/2.8/Cbc/src/CbcThread.cpp

    r1712 r1820  
    595595{
    596596    if (type < 0) {
    597         for (int i = 0; i < numberThreads_; i++) {
    598             assert (children_[i].returnCode() == -1);
     597        // max nodes ?
     598        bool finished = false;
     599        while (!finished) {
     600          finished = true;
     601          for (int i = 0; i < numberThreads_; i++) {
     602            if (abs(children_[i].returnCode()) != 1) {
     603              children_[i].wait(1, 0);
     604              finished=false;
     605            }
     606          }
    599607        }
    600608        return;
     
    835843        return anyLeft;
    836844    } else if (type == 2) {
    837         assert (baseModel->tree()->empty());
     845        if (!baseModel->tree()->empty()) {
     846          // max nodes ?
     847          bool finished = false;
     848          while (!finished) {
     849            finished = true;
     850            for (int iThread = 0; iThread < numberThreads_; iThread++) {
     851              if (children_[iThread].returnCode() == 0) {
     852                double time = getTime();
     853                children_[numberThreads_].wait(0, 0);
     854                children_[numberThreads_].incrementTimeInThread(getTime() - time);
     855                finished = false;
     856                children_[iThread].signal(); // unlock
     857              }
     858            }
     859          }
     860        }
    838861        int i;
    839         for (i = 0; i < numberThreads_; i++)
    840             assert (children_[i].returnCode() == -1);
    841862        // do statistics
    842863        // Seems to be bug in CoinCpu on Linux - does threads as well despite documentation
Note: See TracChangeset for help on using the changeset viewer.