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 <[email protected]> Authored: Wed Dec 23 14:15:42 2015 +0800 Committer: WANG Sheng <[email protected]> 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 <path>" 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();
