diff --git a/fastlib/trunk/contrib/dongryel/thesis_research/core/gnp/distributed_dualtree_dfs_dev.h b/fastlib/trunk/contrib/dongryel/thesis_research/core/gnp/distributed_dualtree_dfs_dev.h index 9584b09008..ede6e4fa51 100644 --- a/fastlib/trunk/contrib/dongryel/thesis_research/core/gnp/distributed_dualtree_dfs_dev.h +++ b/fastlib/trunk/contrib/dongryel/thesis_research/core/gnp/distributed_dualtree_dfs_dev.h @@ -79,25 +79,28 @@ void DistributedDualtreeDfs::AllToAllReduce_( } } + // The computation loop. + bool exchange_done = false; do { // Try to exchange the subtables. If we are done, then we exit the // loop. if( + exchange_done == false && table_exchange.AllToAll( *world_, max_num_levels_to_serialize_, *(reference_table_->local_table()), receive_requests)) { // At this point, try to empty the priority queue. + exchange_done = true; max_num_work_to_dequeue_per_stage_ = std::numeric_limits::max(); + } + if(exchange_done) { bool all_done = true; for(int i = 0; i < world_->size() && all_done; i++) { all_done = (computation_frontier[i].size() == 0); } - bool global_all_done = true; - boost::mpi::all_reduce( - *world_, all_done, global_all_done, std::logical_and()); - if(global_all_done) { + if(all_done) { break; } } diff --git a/fastlib/trunk/contrib/dongryel/thesis_research/core/parallel/table_exchange.h b/fastlib/trunk/contrib/dongryel/thesis_research/core/parallel/table_exchange.h index 7f3420f8d8..cdeb082207 100644 --- a/fastlib/trunk/contrib/dongryel/thesis_research/core/parallel/table_exchange.h +++ b/fastlib/trunk/contrib/dongryel/thesis_research/core/parallel/table_exchange.h @@ -72,6 +72,10 @@ class TableExchange { } // The code should not get to this point. + fprintf(stderr, "There is something wrong. " + "The subtable ID (%d, %d %d) could not be found.\n", + process_id, begin, count); + exit(0); return NULL; }