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 94D5E18CC9 for ; Tue, 29 Dec 2015 14:07:37 +0000 (UTC) Received: (qmail 25535 invoked by uid 500); 29 Dec 2015 14:07:37 -0000 Delivered-To: apmail-singa-commits-archive@singa.apache.org Received: (qmail 25491 invoked by uid 500); 29 Dec 2015 14:07:37 -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 25480 invoked by uid 99); 29 Dec 2015 14:07:37 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Dec 2015 14:07:37 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id D2F331A0099 for ; Tue, 29 Dec 2015 14:07:36 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.247 X-Spam-Level: * X-Spam-Status: No, score=1.247 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-0.554, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id omziltPgF9AI for ; Tue, 29 Dec 2015 14:07:29 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with SMTP id E7A4E20CB8 for ; Tue, 29 Dec 2015 14:07:28 +0000 (UTC) Received: (qmail 25417 invoked by uid 99); 29 Dec 2015 14:07:28 -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; Tue, 29 Dec 2015 14:07:28 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id CAA23E0A1F; Tue, 29 Dec 2015 14:07:27 +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: Tue, 29 Dec 2015 14:07:27 -0000 Message-Id: <116ad96d226047bcaed001604a1c94f3@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/3] incubator-singa git commit: SINGA-114 Remove short logs in tmp directory Repository: incubator-singa Updated Branches: refs/heads/master 0cb6cc222 -> 1bc50075c SINGA-114 Remove short logs in tmp directory Init log dir before calling cluster setup Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/aea0f1ab Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/aea0f1ab Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/aea0f1ab Branch: refs/heads/master Commit: aea0f1abaa96b930ca9bbe64e34949a15955b880 Parents: 0cb6cc2 Author: WANG Sheng Authored: Wed Dec 23 14:15:42 2015 +0800 Committer: WANG Sheng Committed: Mon Dec 28 16:57:34 2015 +0800 ---------------------------------------------------------------------- src/driver.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/aea0f1ab/src/driver.cc ---------------------------------------------------------------------- diff --git a/src/driver.cc b/src/driver.cc index 4eb474a..1bb9335 100644 --- a/src/driver.cc +++ b/src/driver.cc @@ -55,6 +55,9 @@ void Driver::Init(int argc, char **argv) { ReadProtoFromTextFile(argv[arg_pos+1], &singa_conf_); else ReadProtoFromTextFile("conf/singa.conf", &singa_conf_); + // set log path + if (singa_conf_.has_log_dir()) + SetupLog(singa_conf_.log_dir(), "driver"); // job conf passed by users as "-conf " arg_pos = ArgPos(argc, argv, "-conf"); CHECK_NE(arg_pos, -1); @@ -156,10 +159,10 @@ void Driver::Train(bool resume, const std::string str) { } void Driver::Train(bool resume, const JobProto& job_conf) { - Cluster::Setup(job_id_, singa_conf_, job_conf.cluster()); if (singa_conf_.has_log_dir()) SetupLog(singa_conf_.log_dir(), std::to_string(job_id_) + "-" + job_conf.name()); + Cluster::Setup(job_id_, singa_conf_, job_conf.cluster()); tinydir_dir workspace; if (tinydir_open(&workspace, job_conf.cluster().workspace().c_str()) == -1) LOG(FATAL) << "workspace not exist: " << job_conf.cluster().workspace();