I have a bunch of MPI processes exchanging request messages back and forth. Processes do not know which other processes will send them messages, or how many. Given this situation, I want an efficient way to know whether all other processes consider themselves done sending messages.
This would be accomplished perfectly by the following nonblocking version of MPI_Barrier, which we'll call MPI_Ibarrier:
int MPI_Ibarrier(MPI_Comm comm, MPI_Request* request);
MPI_Ibarrier would return immediately, and standard operations on the request object would let us know when the barrier has been reached by everyone.
Is there a way to simulate this behavior efficiently in MPI 2 (i.e., without official nonblocking collectives)?