title: How to write a parallel loop in julia?
body: <p>I have the following Julia code and I would like to parallelize it.</p>
  
  <pre><code>using DistributedArrays
  
  function f(x)
      return x^2;
  end
  y = DArray[]
  @parallel for i in 1:100
      y[i] = f(i)
  end
  println(y)
  </code></pre>
  
  <p>The output is <code>DistributedArrays.DArray[]</code>. I would like to have the value of y as follows: <code>y=[1,4,9,16,...,10000]</code></p>