title: MPI4Py comm.Barrier() not blocking on MSMPI?
body: <p>While implementing a parallel algorithm in Python 3.7.0 using MPI4PY 3.0.0 on MSMPI on Windows 10, I was having problems with the Gatherv not gathering everything... When cheking printing of various bits it seemed to be executing things in the wrong order.</p>
  
  <p>I wrote a bit of code that duplicates the problem :</p>
  
  <pre><code>from mpi4py import MPI
  from time import sleep
  import random
  
  comm = MPI.COMM_WORLD
  rank = comm.Get_rank()
  
  
  if rank == 0:
      sleep(2)
      print("head finished sleeping")
  
  comm.Barrier()
  
  sleep(random.uniform(0, 2))
  print(rank, 'finished sleeping ')
  
  comm.Barrier()
  
  if rank == 0:
      print("All done!")
  </code></pre>
  
  <p>If I understand <code>comm.Barrier()</code> correctly this should produce </p>
  
  <pre><code>head finished sleeping
  2 finished sleeping
  0 finished sleeping
  3 finished sleeping
  1 finished sleeping
  4 finished sleeping
  All done!
  </code></pre>
  
  <p>with the middle bits in some order, right? But when I actually run <code>mpiexec -n 5 python .\blocking_test.py</code> I get as follows:</p>
  
  <pre><code>2 finished sleeping
  1 finished sleeping
  3 finished sleeping
  head finished sleeping
  0 finished sleeping
  All done!
  4 finished sleeping
  </code></pre>
  
  <p>Do I misunderstand the usage of <code>comm.Barrier()</code>, or is there something wrong with my environment?</p>