Skip to content

Commit

Permalink
Fixing the hang when search is run on single thread (#578)
Browse files Browse the repository at this point in the history
* Fixing the hang when search is run on single thread

* Fixing code freeze for single-threaded search

---------

Co-authored-by: Gopal Srinivasa <[email protected]>
  • Loading branch information
gopalrs and gopal-msr authored Aug 14, 2024
1 parent c864227 commit fd93a04
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/pq_flash_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,6 @@ template <typename T, typename LabelT> void PQFlashIndex<T, LabelT>::load_cache_
diskann::cout << "Loading the cache list into memory.." << std::flush;
size_t num_cached_nodes = node_list.size();

// borrow thread data
ScratchStoreManager<SSDThreadData<T>> manager(this->_thread_data);
auto this_thread_data = manager.scratch_space();
IOContext &ctx = this_thread_data->ctx;

// Allocate space for neighborhood cache
_nhood_cache_buf = new uint32_t[num_cached_nodes * (_max_degree + 1)];
memset(_nhood_cache_buf, 0, num_cached_nodes * (_max_degree + 1));
Expand Down Expand Up @@ -506,10 +501,6 @@ template <typename T, typename LabelT> void PQFlashIndex<T, LabelT>::use_medoids
alloc_aligned(((void **)&_centroid_data), _num_medoids * _aligned_dim * sizeof(float), 32);
std::memset(_centroid_data, 0, _num_medoids * _aligned_dim * sizeof(float));

// borrow ctx
ScratchStoreManager<SSDThreadData<T>> manager(this->_thread_data);
auto data = manager.scratch_space();
IOContext &ctx = data->ctx;
diskann::cout << "Loading centroid data from medoids vector data of " << _num_medoids << " medoid(s)" << std::endl;

std::vector<uint32_t> nodes_to_read;
Expand Down

0 comments on commit fd93a04

Please sign in to comment.