From 4a254c100a7565633fb79d57bffafdcb4e8f03db Mon Sep 17 00:00:00 2001 From: Paul Baltescu Date: Thu, 23 May 2013 22:14:32 +0100 Subject: Minor fixes. --- extractor/run_extractor.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'extractor') diff --git a/extractor/run_extractor.cc b/extractor/run_extractor.cc index 2fc6f724..6cee42d5 100644 --- a/extractor/run_extractor.cc +++ b/extractor/run_extractor.cc @@ -42,11 +42,12 @@ fs::path GetGrammarFilePath(const fs::path& grammar_path, int file_number) { } int main(int argc, char** argv) { - int num_threads_default = 1; - #pragma omp parallel - num_threads_default = omp_get_num_threads(); - // Sets up the command line arguments map. + int max_threads = 1; + #pragma omp parallel + max_threads = omp_get_num_threads(); + string threads_option = "Number of parallel threads for extraction " + "(max=" + to_string(max_threads) + ")"; po::options_description desc("Command line options"); desc.add_options() ("help,h", "Show available options") @@ -55,8 +56,7 @@ int main(int argc, char** argv) { ("bitext,b", po::value(), "Parallel text (source ||| target)") ("alignment,a", po::value()->required(), "Bitext word alignment") ("grammars,g", po::value()->required(), "Grammars output path") - ("threads,t", po::value()->default_value(num_threads_default), - "Number of parallel extractors") + ("threads,t", po::value()->default_value(1), threads_option.c_str()) ("frequent", po::value()->default_value(100), "Number of precomputed frequent patterns") ("super_frequent", po::value()->default_value(10), @@ -97,7 +97,7 @@ int main(int argc, char** argv) { } int num_threads = vm["threads"].as(); - cout << "Grammar extraction will use " << num_threads << " threads." << endl; + cerr << "Grammar extraction will use " << num_threads << " threads." << endl; // Reads the parallel corpus. Clock::time_point preprocess_start_time = Clock::now(); @@ -229,7 +229,7 @@ int main(int argc, char** argv) { } for (size_t i = 0; i < sentences.size(); ++i) { - cout << " " << sentences[i] << " " << suffixes[i] << endl; } -- cgit v1.2.3