Skip to content

Commit

Permalink
Exp: make changes to debug statements
Browse files Browse the repository at this point in the history
  • Loading branch information
yemaedahrav committed Sep 6, 2024
1 parent ed26061 commit 7a3822d
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,6 @@ std::pair<uint32_t, uint32_t> Index<T, TagT, LabelT>::iterate_to_fixed_point(

uint32_t hops = 0;
uint32_t cmps = 0;
size_t iter_count = 1;
while (best_L_nodes.has_unexpanded_node())
{
auto nbr = best_L_nodes.closest_unexpanded();
Expand All @@ -889,10 +888,9 @@ std::pair<uint32_t, uint32_t> Index<T, TagT, LabelT>::iterate_to_fixed_point(
std::vector<uint32_t> id_scratch_temp = {n};
std::vector<float> dist_scratch_temp = {0.0};
compute_dists(id_scratch_temp, dist_scratch_temp);
diskann::cout<<"hop #"<<hops+1<<": "<<dist_scratch_temp[0]<<std::endl;
diskann::cout<<"Iteration: "<<iter_count<<std::endl;
diskann::cout<<"L size: "<<best_L_nodes.size()<<std::endl;
diskann::cout<<"Node expanded: "<<nbr.id<<std::endl;
diskann::cout<<"Iteration/Hop: #"<<hops+1<<std::endl;
diskann::cout<<"Current L size: "<<best_L_nodes.size()<<std::endl;
diskann::cout<<"Node expanded(ID) : "<<nbr.id<<" Distance(ID,Query): "<<dist_scratch_temp[0]<<std::endl;
}
hops++;

Expand Down Expand Up @@ -979,8 +977,8 @@ std::pair<uint32_t, uint32_t> Index<T, TagT, LabelT>::iterate_to_fixed_point(

// Insert <id, dist> pairs into the pool of candidates
if (search_invocation){
diskann::cout<<"Comparisons "<<(uint32_t)id_scratch.size()<<std::endl;
diskann::cout<<"Distances"<<std::endl;
diskann::cout<<"Comparisons(Neighbors of ID) "<<(uint32_t)id_scratch.size()<<std::endl;
diskann::cout<<"Distances of Neighbors: ID, Query"<<std::endl;
}
for (size_t m = 0; m < id_scratch.size(); ++m)
{
Expand All @@ -992,10 +990,10 @@ std::pair<uint32_t, uint32_t> Index<T, TagT, LabelT>::iterate_to_fixed_point(
}
}
if (search_invocation){
diskann::cout<<"Total hops: "<<hops<<std::endl;
diskann::cout<<"Total Iterations/Hops: "<<hops<<std::endl;
diskann::cout<<"Total comparisons: "<<cmps<<std::endl;
diskann::cout<<"L size: "<<best_L_nodes.size()<<std::endl;
diskann::cout<<"Expanded Nodes "<<scratch->expanded_nodes_vec().size()<<std::endl;
diskann::cout<<"Expanded Nodes List"<<scratch->expanded_nodes_vec().size()<<std::endl;
for(auto neighbor : scratch->expanded_nodes_vec()){
diskann::cout<<neighbor.id<<std::endl;
}
Expand Down

0 comments on commit 7a3822d

Please sign in to comment.