Changeset 2086


Ignore:
Timestamp:
Jan 15, 2015 3:55:27 AM (5 years ago)
Author:
forrest
Message:

cleaner way for thread barrier

Location:
trunk/Clp/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Clp/src/ClpSimplex.hpp

    r2085 r2086  
    268268     /// Primal initial solve
    269269     int initialPrimalSolve();
    270 /// Barrier initial solve
     270     /// Barrier initial solve
    271271     int initialBarrierSolve();
    272272     /// Barrier initial solve, not to be followed by crossover
     
    17281728#define DEVEX_TRY_NORM 1.0e-4
    17291729#define DEVEX_ADD_ONE 1.0
    1730 #if defined(ABC_INHERIT) || defined(THREADS_IN_ANALYZE)
    1731 #ifndef NORMAL_PTHREADS
    1732 #define NORMAL_PTHREADS
    1733 #endif
    1734 #endif
    17351730#if defined(ABC_INHERIT) || defined(CBC_THREAD) || defined(THREADS_IN_ANALYZE)
    17361731// Use pthreads
     
    17661761  inline pthread_mutex_t * mutexPointer(int which,int thread=0)
    17671762  { return mutex_+which+3*thread;}
    1768 #ifdef NORMAL_PTHREADS
     1763#ifdef PTHREAD_BARRIER_SERIAL_THREAD
    17691764  inline pthread_barrier_t * barrierPointer()
    17701765  { return &barrier_;}
     
    17841779  // For waking up thread
    17851780  pthread_mutex_t mutex_[3*(NUMBER_THREADS+1)];
    1786 #ifdef NORMAL_PTHREADS
     1781#ifdef PTHREAD_BARRIER_SERIAL_THREAD
    17871782  pthread_barrier_t barrier_;
    17881783#endif
  • trunk/Clp/src/ClpSolve.cpp

    r2085 r2086  
    56415641  threadInfo->status=-1;
    56425642  int * which = threadInfo->stuff;
    5643 #ifdef NORMAL_PTHREADS
     5643#ifdef PTHREAD_BARRIER_SERIAL_THREAD
    56445644  pthread_barrier_wait(driver->barrierPointer());
    56455645#endif
     
    57155715    threadInfo_[iThread].status = 100;
    57165716  }
    5717 #ifdef NORMAL_PTHREADS
     5717#ifdef PTHREAD_BARRIER_SERIAL_THREAD
    57185718  //pthread_barrierattr_t attr;
    57195719  pthread_barrier_init(&barrier_, /*&attr*/ NULL, numberThreads+1);
     
    57225722    pthread_create(&abcThread_[iThread], NULL, parallelManager, reinterpret_cast<void *>(this));
    57235723  }
    5724 #ifdef NORMAL_PTHREADS
     5724#ifdef PTHREAD_BARRIER_SERIAL_THREAD
    57255725  pthread_barrier_wait(&barrier_);
    57265726  pthread_barrier_destroy(&barrier_);
Note: See TracChangeset for help on using the changeset viewer.