From 71b68a158a0ca2b5ea738b457b17e3f54b91683b Mon Sep 17 00:00:00 2001 From: Paul Baltescu Date: Tue, 23 Apr 2013 22:34:02 +0100 Subject: Print num threads used for grammar extraction. --- extractor/run_extractor.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'extractor') diff --git a/extractor/run_extractor.cc b/extractor/run_extractor.cc index d5ff23b2..aec83e3b 100644 --- a/extractor/run_extractor.cc +++ b/extractor/run_extractor.cc @@ -96,6 +96,9 @@ int main(int argc, char** argv) { return 1; } + int num_threads = vm["threads"].as(); + cout << "Grammar extraction will use " << num_threads << " threads." << endl; + // Reads the parallel corpus. Clock::time_point preprocess_start_time = Clock::now(); cerr << "Reading source and target data..." << endl; @@ -210,8 +213,7 @@ int main(int argc, char** argv) { // Extracts the grammar for each sentence and saves it to a file. vector suffixes(sentences.size()); - #pragma omp parallel for schedule(dynamic) \ - num_threads(vm["threads"].as()) + #pragma omp parallel for schedule(dynamic) num_threads(num_threads) for (size_t i = 0; i < sentences.size(); ++i) { string suffix; int position = sentences[i].find("|||"); -- cgit v1.2.3