Subtable test fix.

This commit is contained in:
Dongryeol Lee
2011-02-08 17:14:13 +00:00
parent 260ae78304
commit 7c9fc7fb03
2 changed files with 2 additions and 33 deletions
@@ -151,9 +151,6 @@ class TestSubTable {
}
boost::mpi::broadcast(world, max_num_levels_to_serialize, 0);
// Define cache block size naively.
int cache_block_size = (1 << max_num_levels_to_serialize) * leaf_size;
// The master thinks of how many subtables to exchange.
int num_subtables_to_exchange;
if(world.rank() == 0) {
@@ -162,24 +159,6 @@ class TestSubTable {
}
boost::mpi::broadcast(world, num_subtables_to_exchange, 0);
std::vector< std::vector< core::table::DenseMatrix> > data_matrices(
world.size());
std::vector< std::vector< OldFromNewIndexType * > > old_from_news(
world.size());
for(int j = 0; j < world.size(); j++) {
if(j != world.rank()) {
data_matrices[j].resize(num_subtables_to_exchange);
old_from_news[j].resize(num_subtables_to_exchange);
for(int i = 0; i < num_subtables_to_exchange; i++) {
data_matrices[j][i].Init(
distributed_table.n_attributes(), cache_block_size);
old_from_news[j][i] =
new OldFromNewIndexType[ cache_block_size ];
}
}
}
// Prepare the list of subtables.
std::vector< SubTableListType > send_subtables(world.size());
for(int j = 0; j < world.size(); j++) {
@@ -213,8 +192,7 @@ class TestSubTable {
// Allocate the cache block to the subtable that is about
// to be received.
received_subtables_in_this_round[j].push_back(
j, data_matrices[j][i], old_from_news[j][i],
0, cache_block_size, max_num_levels_to_serialize, false);
0, max_num_levels_to_serialize, false);
}
}
}
@@ -233,13 +211,6 @@ class TestSubTable {
}
}
// Free memory.
for(unsigned int i = 0; i < old_from_news.size(); i++) {
for(unsigned int j = 0; j < old_from_news[i].size(); j++) {
delete[] old_from_news[i][j];
}
}
printf("%d-th exchange done!\n\n", k);
world.barrier();
@@ -815,11 +815,9 @@ class KdeStatistic {
private:
// For Boost serialization.
friend class boost::serialization::access;
KdeStatistic(const KdeStatistic &stat_in) {
}
public:
mlpack::kde::KdePostponed postponed_;