GithubHelp home page GithubHelp logo

palmtree's People

Contributors

ranxian avatar runshenzhu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

palmtree's Issues

Possible use of uninitialized value `GHz`

I tried to build this project using clang++ and it reported some errors different from GCC.

In Line 149, I think we should use MHz, since GHz is not initialized in this branch.

palmtree/CycleTimer.h

Lines 145 to 151 in e4fb5d0

} else if (MHz_str) {
*MHz_str = '\0';
if (1 == sscanf(after_at, "%f", &MHz)) {
//printf("MHz = %f\n", MHz);
secondsPerTick_val = 1e-6f / GHz;
break;
}

Reference: Line 156

palmtree/CycleTimer.h

Lines 154 to 158 in e4fb5d0

} else if (1 == sscanf(input, "cpu MHz : %f", &MHz)) {
//printf("MHz = %f\n", MHz);
secondsPerTick_val = 1e-6f / MHz;
break;
}

Potential data races in function redistribute_inner_tasks?

void redistribute_inner_tasks(int layer, NodeModsMapType &cur_mods) {
  cur_mods = node_mods_[layer];

  // discard
  for (int i = 0; i < worker_id_; i++) {
    auto &wthread = palmtree_->workers_[i];
    for (auto other_itr = wthread.node_mods_[layer].begin();
         other_itr != wthread.node_mods_[layer].end(); other_itr++) {
      cur_mods.erase(other_itr->first);
    }
  }

  // Steal work from other threads
  for (int i = worker_id_ + 1; i < palmtree_->NUM_WORKER; i++) {
    auto &wthread = palmtree_->workers_[i];
    for (auto other_itr = wthread.node_mods_[layer].begin();
         other_itr != wthread.node_mods_[layer].end(); other_itr++) {
      auto itr = cur_mods.find(other_itr->first);
      if (itr != cur_mods.end()) {
        auto &my_mods = itr->second;
        auto &other_mods = other_itr->second;
        my_mods.insert(my_mods.end(), other_mods.begin(), other_mods.end());
      }
    }
  }
}

While some thread is traversing a thread's node_mods_[layer], the thread may erase some elements of it. I think there exist data races.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.