Skip to content

Commit

Permalink
Display number threads that are really used
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMarex committed May 1, 2014
1 parent 9183063 commit b4a762f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions extractor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 4 additions & 2 deletions prepare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b4a762f

Please sign in to comment.