Move setting up task_scheduler_init from executables to library

Make entry points of individual pipeline stages responsible for
configuring the task scheduler with requested number of threads
passed in corresponding configuration bundle (ie. follow extractor).
This commit is contained in:
Mateusz Loskot
2018-02-02 12:30:46 +01:00
committed by Patrick Niklaus
parent 2987292cc0
commit 30ed1fae99
7 changed files with 20 additions and 7 deletions
+2
View File
@@ -37,6 +37,7 @@
#include "extractor/tarjan_scc.hpp"
#include <boost/assert.hpp>
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/iterator/function_input_iterator.hpp>
@@ -193,6 +194,7 @@ int Extractor::run(ScriptingEnvironment &scripting_environment)
const auto number_of_threads = std::min(recommended_num_threads, config.requested_num_threads);
tbb::task_scheduler_init init(number_of_threads ? number_of_threads
: tbb::task_scheduler_init::automatic);
BOOST_ASSERT(init.is_active());
guidance::LaneDescriptionMap turn_lane_map;
std::vector<TurnRestriction> turn_restrictions;