Take the 2-minute tour ×

I have an MPI program and MPI_Irecv function to receive a message from MPI_ANY_SOURCE. I need to see who the sender is, I guess from an MPI_Request *req. How do I get it ? I have tried req.MPI_SOURCE but it doesn't exist. Thanks in advance

share|improve this question
add comment

2 Answers


share|improve this answer
+1: Note that the request must be completed in order to obtain a status object, and that after a request is completed the handle is set to MPI_REQUEST_NULL, so you wouldn't be able to obtain the source from it anyway. –  Dave Goodell Jan 10 '11 at 22:03
add comment

If you are using the MPI C++ bindings, call "status.Get_source()". This returns an integer.

share|improve this answer
stay away from MPI C++ bindings: they suck, hence deprecated mpi-forum.org/docs/mpi22-report/node328.htm. If you want C++ MPI use Boost.MPI –  sly Jan 12 '11 at 2:14
add comment

Your Answer


