summaryrefslogtreecommitdiff
path: root/dtrain/dtrain.cc
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2011-09-27 00:12:30 +0200
committerPatrick Simianer <p@simianer.de>2011-09-27 00:12:30 +0200
commitfb6bbeba17c56f5adf7ddcb16b445073883e1b83 (patch)
tree0d3b0647962df55a7a8471f6453ccb2fb1d5dfee /dtrain/dtrain.cc
parent8bb00a2a2775442418f1cb7c041f7cba5d6e0d42 (diff)
tmp param
Diffstat (limited to 'dtrain/dtrain.cc')
-rw-r--r--dtrain/dtrain.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/dtrain/dtrain.cc b/dtrain/dtrain.cc
index 622cd01e..37430fb9 100644
--- a/dtrain/dtrain.cc
+++ b/dtrain/dtrain.cc
@@ -22,7 +22,7 @@ dtrain_init(int argc, char** argv, po::variables_map* cfg)
("hstreaming", po::value<bool>()->zero_tokens(), "run in hadoop streaming mode")
("learning_rate", po::value<double>()->default_value(0.0005), "learning rate")
("gamma", po::value<double>()->default_value(0.), "gamma for SVM (0 for perceptron)")
- ("tmp", po::value<string>()->default_value("/tmp"), "temp dir to use") // FIXME
+ ("tmp", po::value<string>()->default_value("/tmp"), "temp dir to use")
("noup", po::value<bool>()->zero_tokens(), "do not update weights");
po::options_description cl("Command Line Options");
cl.add_options()
@@ -141,7 +141,9 @@ main(int argc, char** argv)
vector<string> src_str_buf; // source strings
vector<vector<WordID> > ref_ids_buf; // references as WordID vecs
// this is for writing the grammar buffer file
- char grammar_buf_fn[] = DTRAIN_TMP_DIR"/dtrain-grammars-XXXXXX";
+ char grammar_buf_fn[1024];
+ strcpy(grammar_buf_fn, cfg["tmp"].as<string>().c_str());
+ strcat(grammar_buf_fn, "/dtrain-grammars-XXXXXX");
mkstemp(grammar_buf_fn);
ogzstream grammar_buf_out;
grammar_buf_out.open(grammar_buf_fn);
@@ -337,7 +339,7 @@ main(int argc, char** argv)
++ii;
- if (hstreaming) cerr << "reporter:counter:dtrain,sid," << in_split[0] << endl;
+ if (hstreaming) cerr << "reporter:counter:dtrain,sid," << ii << endl;
} // input loop