Bug fixed. Now need to deal with the MPI message sizes.
This commit is contained in:
+11
-5
@@ -114,7 +114,7 @@ void DistributedDualtreeDfs<DistributedProblemType>::AllToAllReduce_(
|
||||
if(i != world_->rank()) {
|
||||
for(unsigned int j = 0; j < computation_frontier[i].size(); j++) {
|
||||
int sorted_index = computation_frontier_priorities[i][j].first;
|
||||
DualtreeDfs<ProblemType> sub_engine;
|
||||
core::gnp::DualtreeDfs<ProblemType> sub_engine;
|
||||
ProblemType sub_problem;
|
||||
ArgumentType sub_argument;
|
||||
SubTableType &frontier_reference_subtable =
|
||||
@@ -152,10 +152,16 @@ void DistributedDualtreeDfs<DistributedProblemType>::AllToAllReduce_(
|
||||
sub_engine.unpruned_query_reference_pairs().end());
|
||||
|
||||
// Insert the priorities for the new computation.
|
||||
new_computation_frontier_priorities[i].insert(
|
||||
new_computation_frontier_priorities[i].end(),
|
||||
sub_engine.unpruned_query_reference_pair_priorities().begin(),
|
||||
sub_engine.unpruned_query_reference_pair_priorities().end());
|
||||
int initial_new_computation_frontier_priorities_size =
|
||||
new_computation_frontier_priorities[i].size();
|
||||
for(unsigned int k = 0;
|
||||
k < sub_engine.unpruned_query_reference_pair_priorities().size();
|
||||
k++) {
|
||||
new_computation_frontier_priorities[i].push_back(
|
||||
sub_engine.unpruned_query_reference_pair_priorities()[k]);
|
||||
new_computation_frontier_priorities[i].back().first +=
|
||||
initial_new_computation_frontier_priorities_size;
|
||||
}
|
||||
|
||||
} // Looping over each of the outstanding work from the $i$-th
|
||||
// process.
|
||||
|
||||
@@ -403,7 +403,7 @@ bool DualtreeDfs<ProblemType>::DualtreeCanonical_(
|
||||
qnode, std::pair<int, int>(rnode->begin(), rnode->count())));
|
||||
unpruned_query_reference_pair_priorities_.push_back(
|
||||
std::pair<int, double>(
|
||||
unpruned_query_reference_pair_priorities_.size(),
|
||||
unpruned_query_reference_pairs_.size() - 1,
|
||||
squared_distance_range.lo));
|
||||
unpruned_reference_nodes_[rnode->begin()] = rnode->count();
|
||||
}
|
||||
|
||||
+15
-2
@@ -306,14 +306,27 @@ class TestDistributed_Kde {
|
||||
distributed_kde_instance.Compute(
|
||||
distributed_kde_arguments, &distributed_kde_result);
|
||||
|
||||
// For each process, check whether all the othe reference points
|
||||
// have been encountered.
|
||||
DistributedTableType *distributed_reference_table =
|
||||
distributed_kde_arguments.reference_table_;
|
||||
int total_num_points = -1;
|
||||
for(int i = 0; i < world.size(); i++) {
|
||||
total_num_points += distributed_reference_table->local_n_entries(i);
|
||||
}
|
||||
for(unsigned int i = 0; i < distributed_kde_result.pruned_.size(); i++) {
|
||||
if(distributed_kde_result.pruned_[i] != total_num_points) {
|
||||
std::cerr << "Not all reference point have been accounted for.\n";
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
// Call the ultra-naive.
|
||||
std::vector<double> ultra_naive_distributed_kde_result;
|
||||
|
||||
// The master collects all the distributed tables and collects a
|
||||
// mega-table for which can be used to compute the naive
|
||||
// results.
|
||||
DistributedTableType *distributed_reference_table =
|
||||
distributed_kde_arguments.reference_table_;
|
||||
TableType combined_reference_table;
|
||||
int *total_distribution;
|
||||
CombineTables_(
|
||||
|
||||
Reference in New Issue
Block a user