You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@singa.apache.org by wa...@apache.org on 2015/05/20 14:58:36 UTC
incubator-singa git commit: fix compile bugs about gflags
Repository: incubator-singa
Updated Branches:
refs/heads/master 906124556 -> 679573adf
fix compile bugs about gflags
Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/679573ad
Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/679573ad
Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/679573ad
Branch: refs/heads/master
Commit: 679573adf1552b7ed30bc7b228ae101ce139f0d3
Parents: 9061245
Author: wang wei <wa...@comp.nus.edu.sg>
Authored: Wed May 20 20:57:57 2015 +0800
Committer: wang wei <wa...@comp.nus.edu.sg>
Committed: Wed May 20 20:57:57 2015 +0800
----------------------------------------------------------------------
include/trainer/worker.h | 1 +
src/trainer/worker.cc | 3 +--
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/679573ad/include/trainer/worker.h
----------------------------------------------------------------------
diff --git a/include/trainer/worker.h b/include/trainer/worker.h
index ec07210..a202e93 100644
--- a/include/trainer/worker.h
+++ b/include/trainer/worker.h
@@ -9,6 +9,7 @@
#include "communication/msg.h"
namespace singa {
+const int kCollectSleepTime=5;//milliseconds;
/**
* The Worker class which runs the training algorithm.
* The first worker group will initialize parameters of the Net,
http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/679573ad/src/trainer/worker.cc
----------------------------------------------------------------------
diff --git a/src/trainer/worker.cc b/src/trainer/worker.cc
index 0eb0cdd..9ef47a6 100644
--- a/src/trainer/worker.cc
+++ b/src/trainer/worker.cc
@@ -9,7 +9,6 @@
#include "trainer/worker.h"
#include "proto/model.pb.h"
using std::thread;
-DEFINE_int32(sleep, 5, "sleep seconds");
namespace singa {
Worker::Worker(int thread_id, int group_id, int worker_id):
thread_id_(thread_id), group_id_(group_id), worker_id_(worker_id){
@@ -129,7 +128,7 @@ int Worker::CollectAll(shared_ptr<NeuralNet> net, int step){
}
int Worker::Collect(shared_ptr<Param> param, int step){
while(param->version()<step){
- std::this_thread::sleep_for(std::chrono::milliseconds(FLAGS_sleep));
+ std::this_thread::sleep_for(std::chrono::milliseconds(kCollectSleepTime));
}
return 1;
}