Migrate to modern TBB version (#6300)
This commit is contained in:
committed by
GitHub
parent
a98074a051
commit
91895604c9
@@ -27,12 +27,7 @@
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/filesystem/operations.hpp>
|
||||
|
||||
#if TBB_VERSION_MAJOR == 2020
|
||||
#include <tbb/global_control.h>
|
||||
#else
|
||||
#include <tbb/task_scheduler_init.h>
|
||||
#endif
|
||||
|
||||
#include "util/geojson_debug_logger.hpp"
|
||||
#include "util/geojson_debug_policies.hpp"
|
||||
@@ -74,13 +69,8 @@ auto getGraphBisection(const PartitionerConfig &config)
|
||||
|
||||
int Partitioner::Run(const PartitionerConfig &config)
|
||||
{
|
||||
#if TBB_VERSION_MAJOR == 2020
|
||||
tbb::global_control gc(tbb::global_control::max_allowed_parallelism,
|
||||
config.requested_num_threads);
|
||||
#else
|
||||
tbb::task_scheduler_init init(config.requested_num_threads);
|
||||
BOOST_ASSERT(init.is_active());
|
||||
#endif
|
||||
|
||||
const std::vector<BisectionID> &node_based_partition_ids = getGraphBisection(config);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include "util/log.hpp"
|
||||
#include "util/timing_util.hpp"
|
||||
|
||||
#include <tbb/parallel_do.h>
|
||||
#include <tbb/parallel_for_each.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <climits> // for CHAR_BIT
|
||||
@@ -64,12 +64,12 @@ RecursiveBisection::RecursiveBisection(BisectionGraph &bisection_graph_,
|
||||
return TreeNode{std::move(graph), internal_state.SCCDepth()};
|
||||
});
|
||||
|
||||
using Feeder = tbb::parallel_do_feeder<TreeNode>;
|
||||
using Feeder = tbb::feeder<TreeNode>;
|
||||
|
||||
TIMER_START(bisection);
|
||||
|
||||
// Bisect graph into two parts. Get partition point and recurse left and right in parallel.
|
||||
tbb::parallel_do(begin(forest), end(forest), [&](const TreeNode &node, Feeder &feeder) {
|
||||
tbb::parallel_for_each(begin(forest), end(forest), [&](const TreeNode &node, Feeder &feeder) {
|
||||
const auto cut =
|
||||
computeInertialFlowCut(node.graph, num_optimizing_cuts, balance, boundary_factor);
|
||||
const auto center = internal_state.ApplyBisection(
|
||||
|
||||
Reference in New Issue
Block a user