<p>In <a href="https://github.com/mlpack/mlpack/pull/700#discussion_r69978527">src/mlpack/methods/lsh/lsh_search_impl.hpp</a>:</p>
<pre style='color:#555'>&gt; @@ -822,13 +861,13 @@ void LSHSearch&lt;SortPolicy&gt;::Search(const arma::mat&amp; querySet,
&gt;  
&gt;      // An informative book-keeping for the number of neighbor candidates
&gt;      // returned on average.
&gt; +    // Make atomic to avoid race conditions when multiple threads are running
&gt; +    #pragma omp atomic
&gt;      avgIndicesReturned += refIndices.n_elem;
</pre>
<p>Could we use a reduction here in the parallel for definition?  i.e. <code>reduction(+,avgIndicesReturned)</code>.  Then you wouldn't need an atomic here.  It might speed things up (not sure how much).</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/mlpack/mlpack/pull/700/files/c4c8ff950be8a06e06084764f188095c650b7a60#r69978527">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFBGeVGSb5pWELCA_OMZqIJOrcHu4ks5qTV7UgaJpZM4I5KSz">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFN8qKS6FYpI7AGT3w4C8mfoeMQrVks5qTV7UgaJpZM4I5KSz.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/mlpack/mlpack/pull/700/files/c4c8ff950be8a06e06084764f188095c650b7a60#r69978527"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>