From a1b70ebbb14c5a48cd169db5bbd9dee22e624150 Mon Sep 17 00:00:00 2001 From: Dongryeol Lee Date: Mon, 11 Oct 2010 01:45:09 +0000 Subject: [PATCH] Slowly plugging in distributed tree building. --- .../thesis_research/core/table/distributed_table.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/fastlib/trunk/contrib/dongryel/thesis_research/core/table/distributed_table.h b/fastlib/trunk/contrib/dongryel/thesis_research/core/table/distributed_table.h index 6019ff73d4..8b08559dcb 100644 --- a/fastlib/trunk/contrib/dongryel/thesis_research/core/table/distributed_table.h +++ b/fastlib/trunk/contrib/dongryel/thesis_research/core/table/distributed_table.h @@ -181,7 +181,7 @@ class DistributedTable: public boost::noncopyable { // For each process, select a subset of indices to send to the // master node. std::vector sampled_indices; - for(int i = 0; i < this->n_entries(); i++) { + for(int i = 0; i < owned_table_->n_entries(); i++) { if(core::math::Random() <= sample_probability_in) { sampled_indices.push_back(i); } @@ -193,7 +193,7 @@ class DistributedTable: public boost::noncopyable { // Find out the list of points sampled so that we can build a // sampled table to build the tree from. std::vector< std::vector > list_of_sampled_indices; - int total_num_sampled_points = 0; + int total_num_sample_points = 0; boost::mpi::gather( *comm_, sampled_indices, list_of_sampled_indices, 0); @@ -216,10 +216,9 @@ class DistributedTable: public boost::noncopyable { } - // For the other nodes, + // For the other nodes, send the list of indices sampled. else { - boost::mpi::reduce( - *comm_, random_indices.size(), boost::mpi::sum(), 0); + boost::mpi::gather(*comm_, sampled_indices, 0); } }