Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • stable/2.8/Cbc/src/CbcTree.cpp

    r1813 r2023  
    77#include "CbcNode.hpp"
    88#include "CbcTree.hpp"
     9#include "CbcThread.hpp"
    910#include "CbcCountRowCut.hpp"
    1011#include "CbcCompareActual.hpp"
     
    642643    delete [] nodeArray;
    643644    delete [] depth;
     645#ifdef CBC_THREAD
     646    if (model->parallelMode() > 0 && model->master()) {
     647      // need to adjust for ones not on tree
     648      CbcBaseModel * master = model->master();
     649      int numberThreads = master->numberThreads();
     650      for (int i=0;i<numberThreads;i++) {
     651        CbcThread * child = master->child(i);
     652        if (child->node()) {
     653          // adjust
     654          double value = child->node()->objectiveValue();
     655          bestPossibleObjective = CoinMin(bestPossibleObjective, value);
     656        }
     657      }
     658    }
     659#endif
    644660}
    645661
     
    908924        bestPossibleObjective = CoinMin(bestPossibleObjective, lastNode_->objectiveValue());
    909925    }
     926#ifdef CBC_THREAD
     927    if (model->parallelMode() > 0 && model->master()) {
     928      // need to adjust for ones not on tree
     929      CbcBaseModel * master = model->master();
     930      int numberThreads = master->numberThreads();
     931      for (int i=0;i<numberThreads;i++) {
     932        CbcThread * child = master->child(i);
     933        if (child->node()) {
     934          // adjust
     935          double value = child->node()->objectiveValue();
     936          bestPossibleObjective = CoinMin(bestPossibleObjective, value);
     937        }
     938      }
     939    }
     940#endif
    910941    CbcCompareDefault * compareDefault
    911942    = dynamic_cast<CbcCompareDefault *> (comparison_.test_);
     
    956987        }
    957988    }
     989#ifdef CBC_THREAD
     990    if (model->parallelMode() > 0 && model->master()) {
     991      // need to adjust for ones not on tree
     992      CbcBaseModel * master = model->master();
     993      int numberThreads = master->numberThreads();
     994      for (int i=0;i<numberThreads;i++) {
     995        CbcThread * child = master->child(i);
     996        if (child->node()) {
     997          // adjust
     998          double value = child->node()->objectiveValue();
     999          bestPossibleObjective = CoinMin(bestPossibleObjective, value);
     1000        }
     1001      }
     1002    }
     1003#endif
    9581004    if (lastNode_) {
    9591005        double value = lastNode_->objectiveValue();
     
    12591305        }
    12601306    }
     1307#ifdef CBC_THREAD
     1308    if (model->parallelMode() > 0 && model->master()) {
     1309      // need to adjust for ones not on tree
     1310      CbcBaseModel * master = model->master();
     1311      int numberThreads = master->numberThreads();
     1312      for (int i=0;i<numberThreads;i++) {
     1313        CbcThread * child = master->child(i);
     1314        if (child->node()) {
     1315          // adjust
     1316          double value = child->node()->objectiveValue();
     1317          bestPossibleObjective = CoinMin(bestPossibleObjective, value);
     1318        }
     1319      }
     1320    }
     1321#endif
    12611322    /*
    12621323      Rebuild the heap using the retained nodes.
Note: See TracChangeset for help on using the changeset viewer.