[mlpack-git] [mlpack/mlpack] LSHSearch Parallelization (#700)

Ryan Curtin notifications at github.com
Thu Jul 7 16:17:24 EDT 2016


> @@ -822,13 +861,13 @@ void LSHSearch<SortPolicy>::Search(const arma::mat& querySet,
>  
>      // An informative book-keeping for the number of neighbor candidates
>      // returned on average.
> +    // Make atomic to avoid race conditions when multiple threads are running
> +    #pragma omp atomic
>      avgIndicesReturned += refIndices.n_elem;

Could we use a reduction here in the parallel for definition?  i.e. `reduction(+,avgIndicesReturned)`.  Then you wouldn't need an atomic here.  It might speed things up (not sure how much).

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/700/files/c4c8ff950be8a06e06084764f188095c650b7a60#r69978527
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160707/f5f520ee/attachment.html>


More information about the mlpack-git mailing list