title: Generating random numbers in parallel with identical engines fails
body: <p>I am using the RNG provided by C++11 and I am also toying around with OpenMP. I have assigned an engine to each thread and as a test I give the same seed to each engine. This means that I would expect both threads to yield the exact same sequence of randomly generated numbers. Here is a MWE:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;random&gt;
  
  using namespace std;
  
  
  uniform_real_distribution&lt;double&gt; uni(0, 1);
  normal_distribution&lt;double&gt; nor(0, 1);
  
  
  int main()
  {
      #pragma omp parallel
      {
          mt19937 eng(0); //GIVE EACH THREAD ITS OWN ENGINE
          vector&lt;double&gt; vec;
  
          #pragma omp for
          for(int i=0; i&lt;5; i++)
          {
              nor(eng);
              vec.push_back(uni(eng));
          }
          #pragma omp critical
          cout &lt;&lt; vec[0] &lt;&lt; endl;
      }
  
  
  
      return 0;
  }
  </code></pre>
  
  <p>Most often I get the output <code>0.857946  0.857946</code>, but a few times I get <code>0.857946  0.592845</code>. How is the latter result possible, when the two threads have identical, uncorrelated engines?!</p>