From 52e5483dfba9bfbf85b8ffcdfd3e1d210938d480 Mon Sep 17 00:00:00 2001 From: Patrick Niklaus Date: Thu, 1 May 2014 18:32:01 +0200 Subject: [PATCH] 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;