title: Usage of parallel option in numba.jit decoratior makes function give wrong result
body: <p>Given two opposite corners of a rectangle <code>(x1, y1)</code> and <code>(x2, y2)</code> and two radii <code>r1</code> and <code>r2</code>, find the ratio of points that lie between the circles defined by the radii <code>r1</code> and <code>r2</code> to the total number of points in the rectangle.</p>
  
  <p>Simple NumPy approach: </p>
  
  <pre><code>def func_1(x1,y1,x2,y2,r1,r2,n):
       x11,y11 = np.meshgrid(np.linspace(x1,x2,n),np.linspace(y1,y2,n))
       z1 = np.sqrt(x11**2+y11**2)
       a = np.where((z1&gt;(r1)) &amp; (z1&lt;(r2)))
       fill_factor = len(a[0])/(n*n)
       return fill_factor
  </code></pre>
  
  <p>Next I tried to optimize this function with the <code>jit</code> decorator from numba. When I use:</p>
  
  <pre><code>nopython = True
  </code></pre>
  
  <p>The function is faster and gives the right output. But when I also add: </p>
  
  <pre><code>parallel = True
  </code></pre>
  
  <p>The function is faster but gives the wrong result. 
  I know that this has something to do with my <code>z</code> matrix since that is not being updated properly. </p>
  
  <pre><code>@jit(nopython=True,parallel=True)
  def func_2(x1,y1,x2,y2,r1,r2,n):
      x_ = np.linspace(x1,x2,n)
      y_ = np.linspace(y1,y2,n)
      z1 = np.zeros((n,n))
      for i in range(n):
          for j in range(n):
              z1[i][j] = np.sqrt((x_[i]*x_[i]+y_[j]*y_[j]))
      a = np.where((z1&gt;(r1)) &amp; (z1&lt;(r2)))
      fill_factor = len(a[0])/(n*n)
      return fill_factor
  </code></pre>
  
  <p>Test values : </p>
  
  <pre><code>x1 = 1.0
  x2 = -1.0
  y1 = 1.0
  y2 = -1.0
  r1 = 0.5
  r2 = 0.75
  n = 25000
  </code></pre>
  
  <p>Additional info : Python version : 3.6.1, Numba version : 0.34.0+5.g1762237, NumPy version : 1.13.1</p>