
Hi,
On Sun, Nov 28, 2010 at 12:54 PM, Kraus Philipp
The CPU 0 (rank 0) creates a loop with this: while (true) { std::string l_str; p_com.irecv( mpi::any_source, LOGGER_MPI_TAG, l_str ); } p_com is the commuicator object. All other CPUs (!= 0) can send a message to CPU 0, which should be received. The CPUs (!=0) can send a message, but they need not, so I would create this with non-blocking communication. At this time my l_str is alway empty, so it seems that the message, that are send, not transmittet, received or not inserted into l_str.
`irecv` means "start receving" (sort of); the message is actually fully received (and available in `l_str`) when the corresponding request is completed (use mpi::test_* or mpi::wait_* on the return value of the irecv call). If you want the message data to be available as soon as the receive function returns, use `recv` instead of `irecv`:: while(...) { std::string l_str; p_com.recv(mpi::any_source, LOGGER_MPI_TAG, l_str); } Best regards, Riccardo