title: what order do I get messages coming to MPI Recv from MPI_ANY_SOURCE,
body: <p>I am implementing a hub/servers MPI application. Each of the servers can get tied up waiting for some data, then they do an MPI Send to the hub. It is relatively simple for me to have the hub waiting around doing a Recv from ANY_SOURCE. The hub can get busy working with the data. What I'm worried about is skipping data from one of the servers. How likely is this scenario:</p>
  
  <ul>
  <li>server 1 and 2 do Send's</li>
  <li>hub does Recv and ends up getting data from server 1</li>
  <li>while hub busy, server 1 gets more data, does another Send</li>
  <li>when hub does its next Recv, it gets the more recent server 1 data rather than the older server2</li>
  </ul>
  
  <p>I don't need a guarantee that the order the Send's occur is the order the ANY_SOURCE processes them (though it would be nice), but if I new in practice it will be close to the order they are sent, I may go with the above. However if it is likely I could skip over data from one of the servers, I need to implement something more complicated. Which I think would be this pattern:</p>
  
  <ul>
  <li>servers each do Send's</li>
  <li>hub does an Irecv for each server</li>
  <li>hub does a Waitany on all server requests</li>
  <li>upon completion of one server request, hub does a Test on all the others</li>
  <li>of all the Irecv's that have completed, hub selects the oldest server data (there is timing tag in the server data)</li>
  <li>hub communicates with the server it just chose, has it start a new Send, hub a new Irecv</li>
  </ul>
  
  <p>This requires more complex code, and my first effort crashed inside the Waitany call in a way that I'm finding difficult to debug. I am using the Python bindings mpi4py - so I have less control over buffers being used.</p>