From 91830632552ddb6cb84e4b966a8b0eb77c4a4abb Mon Sep 17 00:00:00 2001 From: Patrick Niklaus Date: Thu, 1 May 2014 18:31:21 +0200 Subject: [PATCH 1/2] Fix typos --- Extractor/ExtractionContainers.cpp | 4 ++-- prepare.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Extractor/ExtractionContainers.cpp b/Extractor/ExtractionContainers.cpp index 44c4d6895ff..265bc563710 100644 --- a/Extractor/ExtractionContainers.cpp +++ b/Extractor/ExtractionContainers.cpp @@ -96,7 +96,7 @@ void ExtractionContainers::PrepareData( ); std::cout << "ok, after " << get_timestamp() - time << "s" << std::endl; - std::cout << "[extractor] Sorting restrctns. by from... " << std::flush; + std::cout << "[extractor] Sorting restrictions. by from... " << std::flush; stxxl::sort( restrictions_list.begin(), restrictions_list.end(), @@ -142,7 +142,7 @@ void ExtractionContainers::PrepareData( std::cout << "ok, after " << get_timestamp() - time << "s" << std::endl; time = get_timestamp(); - std::cout << "[extractor] Sorting restrctns. by to ... " << std::flush; + std::cout << "[extractor] Sorting restrictions. by to ... " << std::flush; stxxl::sort( restrictions_list.begin(), restrictions_list.end(), diff --git a/prepare.cpp b/prepare.cpp index b183a06c6cf..57fc7406cc3 100644 --- a/prepare.cpp +++ b/prepare.cpp @@ -245,7 +245,7 @@ int main (int argc, char *argv[]) { trafficLightNodes.size() << " traffic lights"; /*** - * Building an edge-expanded graph from node-based input an turn restrictions + * Building an edge-expanded graph from node-based input and turn restrictions */ SimpleLogger().Write() << "Generating edge-expanded graph representation"; From b4a762f8d0040ffb2480bc526da8f8de9bda8594 Mon Sep 17 00:00:00 2001 From: Patrick Niklaus Date: Thu, 1 May 2014 18:32:01 +0200 Subject: [PATCH 2/2] Display number threads that are really used --- extractor.cpp | 6 ++++-- prepare.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/extractor.cpp b/extractor.cpp index 7520929a738..adbf68b0476 100644 --- a/extractor.cpp +++ b/extractor.cpp @@ -150,14 +150,16 @@ int main (int argc, char *argv[]) { return 1; } + int real_num_threads = std::min(omp_get_num_procs(), requested_num_threads); + SimpleLogger().Write() << "Input file: " << input_path.filename().string(); SimpleLogger().Write() << "Profile: " << profile_path.filename().string(); - SimpleLogger().Write() << "Threads: " << requested_num_threads; + SimpleLogger().Write() << "Threads: " << real_num_threads << " (requested " << requested_num_threads << ")"; /*** Setup Scripting Environment ***/ ScriptingEnvironment scriptingEnvironment(profile_path.c_str()); - omp_set_num_threads(std::min(omp_get_num_procs(), requested_num_threads)); + omp_set_num_threads(real_num_threads); bool file_has_pbf_format(false); std::string output_file_name = input_path.string(); diff --git a/prepare.cpp b/prepare.cpp index 57fc7406cc3..8d51be46f90 100644 --- a/prepare.cpp +++ b/prepare.cpp @@ -149,12 +149,14 @@ int main (int argc, char *argv[]) { return 1; } + int real_num_threads = std::min(omp_get_num_procs(), requested_num_threads); + SimpleLogger().Write() << "Input file: " << input_path.filename().string(); SimpleLogger().Write() << "Restrictions file: " << restrictions_path.filename().string(); SimpleLogger().Write() << "Profile: " << profile_path.filename().string(); - SimpleLogger().Write() << "Threads: " << requested_num_threads; + SimpleLogger().Write() << "Threads: " << real_num_threads << " (requested " << requested_num_threads << ")"; - omp_set_num_threads( std::min( omp_get_num_procs(), requested_num_threads) ); + omp_set_num_threads(real_num_threads); LogPolicy::GetInstance().Unmute(); boost::filesystem::ifstream restrictionsInstream(restrictions_path, std::ios::binary); TurnRestriction restriction;