Boost C++ Libraries: Ticket #10065: wait_any return with -1 https://svn.boost.org/trac10/ticket/10065 <p> I have a small example, where every process send his rank to rank 0. The process with rank 0, should receive with <em>irecv</em> every message and wait for it with <em>wait_any</em>. But the <em>wait_any</em> function returns with -1. I have seen two other tickets, which are marked as fixed/ solved. I think they are not solved. If they are solve the documentation should be changed, because if I make the same example with MPI_Waitany, the result is completely different. </p> <pre class="wiki">#include &lt;stdlib.h&gt; #include &lt;stdio.h&gt; #include &lt;unistd.h&gt; #include &lt;boost/mpi.hpp&gt; #include &lt;iostream&gt; #include &lt;string&gt; #include &lt;boost/serialization/string.hpp&gt; #define MAXPROC 16 /* Max number of procsses */ int main(int argc, char* argv[]) { int i, np, me, index; const int tag = 42; /* Tag value for communication */ const int root = 0; /* Root process in broadcast */ boost::mpi::status status; /* Status object for non-blocing receive */ boost::mpi::request recv_req[MAXPROC]; /* Request objects for non-blocking receive */ int myname[5]; /* Local host name string */ int hostname[5]; /* Received host names */ int namelen; boost::mpi::environment env; /* Initialize MPI */ boost::mpi::communicator world; /* Initialize MPI */ np = world.size(); /* Get nr of processes */ me = world.rank(); /* Get own identifier */ if (me == 0) { /* Process 0 does this */ std::cout &lt;&lt;"Process " &lt;&lt; me &lt;&lt; " broadcasting to all processes\n"; boost::mpi::broadcast(world, me, 0); std::cout &lt;&lt;"Process " &lt;&lt; me&lt;&lt; " receiving from all other processes\n"; for (i=1; i&lt;np; i++) { recv_req[i] = world.irecv(i,i,hostname[i]); } for (i=1; i&lt;np; i++) { status = wait_any(recv_req,recv_req +5 ).first; std::cout&lt;&lt;"Received a message from process "&lt;&lt; status.source() &lt;&lt; " tag " &lt;&lt; status.tag() &lt;&lt; std::endl; } std::cout &lt;&lt;"Ready\n"; } else { int y; boost::mpi::broadcast(world, y, 0); sleep(me%3+1); MPI_Send (myname, namelen, MPI_CHAR, 0, tag, world); } world.barrier(); ~world; return 0; } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10065 Trac 1.4.3