Changeset 685 for branches


Ignore:
Timestamp:
Jul 12, 2007 10:14:00 AM (12 years ago)
Author:
forrest
Message:

try and fix hang on max nodes

Location:
branches/devel/Cbc/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/devel/Cbc/src/CbcLinked.cpp

    r680 r685  
    17271727        objNew->setYOtherSatisfied(oldSatisfied);
    17281728        objNew->setYMeshSize(meshSize);
    1729         objNew->setXYSatisfied(0.5*meshSize);
     1729        objNew->setXYSatisfied(0.25*meshSize);
    17301730        objNew->setPriority(value);
    17311731        objNew->setBranchingStrategy(8);
     
    55585558          }
    55595559        }
     5560        if (testCoarse&&(branchingStrategy_&8)!=0&&xB[1]-xB[0]<1.0001*xSatisfied_&&
     5561            yB[1]-yB[0]<1.0001*ySatisfied_)
     5562          feasible=true;
    55605563        if (feasible) {
    55615564          if (xB[1]-xB[0]>=xSatisfied_&&xMeshSize_) {
  • branches/devel/Cbc/src/CbcModel.cpp

    r674 r685  
    22312231      time += threadInfo[i].timeInThread;
    22322232    bool goodTimer = time<(getCurrentSeconds());
     2233    //bool stopped = (!(numberNodes_ < intParam_[CbcMaxNumNode] &&
     2234    //        numberSolutions_ < intParam_[CbcMaxNumSol] &&
     2235    //        totalTime < dblParam_[CbcMaximumSeconds] &&
     2236    //        !stoppedOnGap_&&!eventHappened_));
    22332237    for (i=0;i<numberThreads_;i++) {
    22342238      while (threadInfo[i].returnCode==0) {
     
    22462250        pthread_mutex_unlock(&condition_mutex);
    22472251      }
     2252      pthread_cond_signal(threadInfo[i].condition2); // unlock
     2253      pthread_mutex_lock(&condition_mutex); // not sure necessary but have had one hang on interrupt
    22482254      threadModel[i]->numberThreads_=0; // say exit
    22492255      threadInfo[i].returnCode=0;
     2256      pthread_mutex_unlock(&condition_mutex);
    22502257      pthread_cond_signal(threadInfo[i].condition2); // unlock
    2251       pthread_join(threadId[i],NULL);
     2258      //if (!stopped)
     2259        pthread_join(threadId[i],NULL);
     2260        //else
     2261        //pthread_kill(threadId[i]); // kill rather than try and synchronize
    22522262      threadModel[i]->moveToModel(this,2);
    22532263      pthread_mutex_destroy (threadInfo[i].mutex2);
     
    1066310673      clock_gettime(CLOCK_REALTIME,&absTime2);
    1066410674      double time2 = absTime2.tv_sec+1.0e-9*absTime2.tv_nsec;
    10665       pthread_cond_wait(condition,mutex);
     10675      // timed wait as seems to hang on max nodes at times
     10676      absTime2.tv_sec += 10;
     10677      pthread_cond_timedwait(condition,mutex,&absTime2);
    1066610678      clock_gettime(CLOCK_REALTIME,&stuff->absTime);
    1066710679      double time = stuff->absTime.tv_sec+1.0e-9*stuff->absTime.tv_nsec;
  • branches/devel/Cbc/src/unitTestClp.cpp

    r676 r685  
    19521952
    19531953    double startTime = CoinCpuTime()+CoinCpuTimeJustChildren();
    1954     model->setMaximumNodes(200000);
     1954    if (model->getMaximumNodes()>200000)
     1955      model->setMaximumNodes(200000);
    19551956    OsiClpSolverInterface * si =
    19561957      dynamic_cast<OsiClpSolverInterface *>(model->solver()) ;
Note: See TracChangeset for help on using the changeset viewer.