Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/vis15/src/lib/parallel-target/scheduler.cxx
ViewVC logotype

Diff of /branches/vis15/src/lib/parallel-target/scheduler.cxx

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4864, Thu Dec 29 18:42:48 2016 UTC revision 4865, Thu Dec 29 18:44:07 2016 UTC
# Line 144  Line 144 
144          cpuId = (sched->_numCoresPerNode * cpuId) + myInfo->_core;          cpuId = (sched->_numCoresPerNode * cpuId) + myInfo->_core;
145          cpuId = sched->_numThdsPerCore * cpuId;          cpuId = sched->_numThdsPerCore * cpuId;
146        // allow worker to run on any thead        // allow worker to run on any thead
147          for (int i = 0;  i < _numThdsPerCore;  i++) {          for (int i = 0;  i < sched->_numThdsPerCore;  i++) {
148              CPU_SET(cpuId+i, &cpus);              CPU_SET(cpuId+i, &cpus);
149          }          }
150          if (sched_setaffinity (0, sizeof(cpu_set_t), &cpus) == -1) {          if (sched_setaffinity (0, sizeof(cpu_set_t), &cpus) == -1) {
# Line 212  Line 212 
212    
213  #if defined(HAVE_SCHED_SETAFFINITY) || defined(HAVE_LIBNUMA)  #if defined(HAVE_SCHED_SETAFFINITY) || defined(HAVE_LIBNUMA)
214        // set the desired worker locations        // set the desired worker locations
215          int workersPerNode = (this->_numWorkers + sched->_numHWNodes - 1) / sched->_numHWNodes;          int workersPerNode = (this->_numWorkers + this->_numHWNodes - 1) / this->_numHWNodes;
216          uint32_t wid = 0;          uint32_t wid = 0;
217          for (uint32_t i = 0;  i < sched->_numHWNodes;  i++) {          for (uint32_t i = 0;  i < this->_numHWNodes;  i++) {
218              for (uint32_t j = 0;  j < workersPerNode;  j++) {              for (uint32_t j = 0;  j < workersPerNode;  j++) {
219                  if (wid < this->_numWorkers) {                  if (wid < this->_numWorkers) {
220                      this->_info[wid]._node = i;                      this->_info[wid]._node = i;
221                      this->_info[wid]._core = j % sched->_numCoresPerNode;                      this->_info[wid]._core = j % this->_numCoresPerNode;
222                      this->_info[wid]._thd = 0;                      this->_info[wid]._thd = 0;
223                      wid++;                      wid++;
224                  }                  }

Legend:
Removed from v.4864  
changed lines
  Added in v.4865

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0