Enabled multithreaded elimination by default

release/4.3a0
Richard Roberts 2013-08-14 19:47:29 +00:00
parent f9eb5b6e2c
commit b0659da607
1 changed files with 6 additions and 3 deletions

View File

@ -291,9 +291,12 @@ namespace gtsam {
boost::shared_ptr<BayesTreeType> result = boost::make_shared<BayesTreeType>();
EliminationData<This> rootsContainer(0, roots_.size());
EliminationPostOrderVisitor<This> visitorPost(function, result->nodes_);
//tbb::task_scheduler_init init(1);
treeTraversal::DepthFirstForest/*Parallel*/(*this, rootsContainer,
eliminationPreOrderVisitor<This>, visitorPost/*, 10*/);
#ifdef ENABLE_TIMING
// In timing mode, use a single thread only, timing outline is not thread-safe.
tbb::task_scheduler_init init(1);
#endif
treeTraversal::DepthFirstForestParallel(*this, rootsContainer,
eliminationPreOrderVisitor<This>, visitorPost, 10);
// Create BayesTree from roots stored in the dummy BayesTree node.
result->roots_.insert(result->roots_.end(), rootsContainer.bayesTreeNode->children.begin(), rootsContainer.bayesTreeNode->children.end());