At the current version of boost, 1.55, boost::mpi
does not guarantee non-overtaking messages. This in contrast to the underlying MPI API which does:
Order Messages are non-overtaking: If a sender sends two messages in succession to the same destination, and both match the same receive, then this operation cannot receive the second message if the first one is still pending. If a receiver posts two receives in succession, and both match the same message, then the second receive operation cannot be satisfied by this message, if the first one is still pending. This requirement facilitates matching of sends to receives. It guarantees that message-passing code is deterministic, if processes are single-threaded and the wildcard MPI_ANY_SOURCE is not used in receives.
The reason boost::mpi
does not guarantee non-overtaking is that serialized data types are transferred in two MPI messages, one for size and one for payload, and irecv
for the second message cannot be posted until the first message is examined.
A proposal to guarantee non-overtaking in boost::mpi
is being considered. Further discussion can be found on the boost::mpi
mailing list beginning here.