Return-Path: X-Original-To: apmail-singa-commits-archive@minotaur.apache.org Delivered-To: apmail-singa-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EC2CC17CBE for ; Wed, 24 Jun 2015 14:33:28 +0000 (UTC) Received: (qmail 39405 invoked by uid 500); 24 Jun 2015 14:33:28 -0000 Delivered-To: apmail-singa-commits-archive@singa.apache.org Received: (qmail 39383 invoked by uid 500); 24 Jun 2015 14:33:28 -0000 Mailing-List: contact commits-help@singa.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@singa.incubator.apache.org Delivered-To: mailing list commits@singa.incubator.apache.org Received: (qmail 39368 invoked by uid 99); 24 Jun 2015 14:33:28 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Jun 2015 14:33:28 +0000 X-ASF-Spam-Status: No, hits=-2001.4 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 24 Jun 2015 14:31:15 +0000 Received: (qmail 39015 invoked by uid 99); 24 Jun 2015 14:33:02 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Jun 2015 14:33:02 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A79D0E0544; Wed, 24 Jun 2015 14:33:02 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: wangwei@apache.org To: commits@singa.incubator.apache.org Date: Wed, 24 Jun 2015 14:33:11 -0000 Message-Id: <73a122d506fd45afa0ec8e6a01fa4eaa@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [10/10] incubator-singa git commit: SINGA-21 Code review X-Virus-Checked: Checked by ClamAV on apache.org SINGA-21 Code review Fix compile warnings and bugs from create_shard.cc of cifar10 example Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/8bf975cb Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/8bf975cb Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/8bf975cb Branch: refs/heads/master Commit: 8bf975cbc8fc55a69561d0ae59e232a81923a542 Parents: ffa2d66 Author: wang wei Authored: Wed Jun 24 22:30:17 2015 +0800 Committer: wang wei Committed: Wed Jun 24 22:30:17 2015 +0800 ---------------------------------------------------------------------- examples/cifar10/create_shard.cc | 1 + src/trainer/server.cc | 1 + src/utils/cluster.cc | 7 ++++--- src/utils/cluster_rt.cc | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/8bf975cb/examples/cifar10/create_shard.cc ---------------------------------------------------------------------- diff --git a/examples/cifar10/create_shard.cc b/examples/cifar10/create_shard.cc index 75e5abe..9df92d6 100644 --- a/examples/cifar10/create_shard.cc +++ b/examples/cifar10/create_shard.cc @@ -19,6 +19,7 @@ #include "utils/data_shard.h" #include "utils/common.h" #include "proto/model.pb.h" +#include "proto/common.pb.h" using std::string; http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/8bf975cb/src/trainer/server.cc ---------------------------------------------------------------------- diff --git a/src/trainer/server.cc b/src/trainer/server.cc index 5662258..04f6040 100644 --- a/src/trainer/server.cc +++ b/src/trainer/server.cc @@ -103,6 +103,7 @@ Msg* Server::HandleGet(shared_ptr param, Msg **msg){ auto reply= param->HandleGetMsg(msg); int paramid=reply->trgt_first(), slice=reply->trgt_second(); reply->set_trgt(paramid, slice, param->version()); + return reply; } } http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/8bf975cb/src/utils/cluster.cc ---------------------------------------------------------------------- diff --git a/src/utils/cluster.cc b/src/utils/cluster.cc index 347b98e..035e0c7 100644 --- a/src/utils/cluster.cc +++ b/src/utils/cluster.cc @@ -21,7 +21,8 @@ Cluster::Cluster(const ClusterProto &cluster, int procs_id) { if(nprocs_>1){ std::ifstream ifs(cluster.hostfile(), std::ifstream::in); std::string line; - while(std::getline(ifs, line)&&endpoints_.size()(nprocs_)){ endpoints_.push_back(line); } CHECK_EQ(endpoints_.size(), nprocs_); @@ -29,7 +30,7 @@ Cluster::Cluster(const ClusterProto &cluster, int procs_id) { // locate the process id of every worker/server int ngrps=cluster_.nworker_groups(), grp_size=cluster_.nworkers_per_group(); - int procs; + int procs=0; for(int i=0;i