diff --git a/fastlib/thor/rbfs_impl.h b/fastlib/thor/rbfs_impl.h index f2cba86bda..4c5e679d69 100644 --- a/fastlib/thor/rbfs_impl.h +++ b/fastlib/thor/rbfs_impl.h @@ -256,12 +256,16 @@ void DualTreeRecursiveBreadth::Divide_( if (likely(GNP::Algorithm::ConsiderPairExtrinsic( param_, q_node, *r_node, item->delta, parent_queue->summary_result, global_result_, &parent_queue->postponed))) { - if (likely(!r_node->is_leaf()) && likely(r_node->count() > 2 * q_node->count())) { + if (likely(!r_node->is_leaf()) && likely(r_node->count() > 2 * q_node.count())) { + // Only divide reference node if it is more than twice the size of the query. + for (int k_r = 0; k_r < GNP::RNode::CARDINALITY; k_r++) { index_t r_child_i = r_node->child(k_r); CacheRead r_child(&r_nodes_, r_child_i); for (int k_q = 0; k_q < GNP::QNode::CARDINALITY; k_q++) { + // Loop for both query children + if (unlikely(r_child->count() > q_children[k_q]->count()) && likely(!r_child->is_leaf())) { // Divide reference set an extra time if the reference node is large. for (int k_r2 = 0; k_r2 < GNP::RNode::CARDINALITY; k_r2++) { @@ -270,7 +274,7 @@ void DualTreeRecursiveBreadth::Divide_( child_queues[k_q].Consider(param_, *q_children[k_q], *r_child2, r_child2_i, &global_result_); } - } else if (likely(q_children[k_q]->count() > r_child->count())) { + } else { child_queues[k_q].Consider(param_, *q_children[k_q], *r_child, r_child_i, &global_result_); } diff --git a/fastlib/thor/rpc_sock.cc b/fastlib/thor/rpc_sock.cc index 4d40d59e5b..4311c71c1a 100644 --- a/fastlib/thor/rpc_sock.cc +++ b/fastlib/thor/rpc_sock.cc @@ -842,7 +842,7 @@ void SockConnection::OpenOutgoing(bool blocking) { if (elapsed_time >= TIMEOUT_CONNECT) { FATAL("Tried connecting to rank %d for %d seconds, bailing out.", - TIMEOUT_CONNECT, peer_); + peer_, TIMEOUT_CONNECT); } sleep(sleeptime); diff --git a/fastlib/u/garryb/nbr/fdkde.cc b/fastlib/u/garryb/nbr/fdkde.cc index dbe4eb45b6..4a87bcc4f7 100644 --- a/fastlib/u/garryb/nbr/fdkde.cc +++ b/fastlib/u/garryb/nbr/fdkde.cc @@ -1,8 +1,8 @@ #include "fastlib/fastlib_int.h" #include "thor/thor.h" -//#define SOLVER_TYPE DualTreeRecursiveBreadth -#define SOLVER_TYPE DualTreeDepthFirst +#define SOLVER_TYPE DualTreeRecursiveBreadth +//#define SOLVER_TYPE DualTreeDepthFirst /** * Approximate kernel density estimation. diff --git a/fastlib/u/garryb/nbr/paper/paper.tex b/fastlib/u/garryb/nbr/paper/paper.tex index 3111b68c26..a763e89e23 100644 --- a/fastlib/u/garryb/nbr/paper/paper.tex +++ b/fastlib/u/garryb/nbr/paper/paper.tex @@ -1069,6 +1069,15 @@ The ultimate goal of a parallel system such as THOR is to use all available cloc In practice, this is unachievable, so we must quantify to the extent that resources are utilized. After explaining our experimental design, we quantify \THOR's three primary opportunities for underutilization: overhead due to code complexity, load imbalances, and communication time. +\subsection{Implementation Notes} + +- Since the GNP is the time consuming part and focus of the paper, that is the only part we parallelize. +We don't parallelize tree building, although \cite{xyz} shows how to do kd-tree construction in parallel. + +- Recognize the "initial transfer" i.e. distribution + +- Acknowledge Intel's donations in my paper. + \subsection{Design} % you just need to state that in a positive light: the framework is geared towards breaking up larger problems; smaller problems can be solved effectively in serial