You can use MPI_REQUEST_GET_STATUS as a way to "test" without deallocation.
I do not understand the reason you would forward the request (as a request) to another function. The data is already in a specific receive buffer by the time an MPI_Test returns TRUE so calling the function and passing it the buffer address, and tag seems functionally equivalent. If the called function needs information from the MPI_Status (beyond tag) returned by MPI_Test you can pass it the status you get back. The MPI_Status is in application managed memory so the function can do whatever you like with it after it has referenced it for the data. malloc a status MPI_Test if (flag == TRUE) call function passing the status structure // use tag info from status to pick the function & let the function free the status If you do pass the un-deallocated request, remember your function must still MPI_Wait it. Dick Treumann - MPI Team IBM Systems & Technology Group Dept X2ZA / MS P963 -- 2455 South Road -- Poughkeepsie, NY 12601 Tele (845) 433-7846 Fax (845) 433-8363 users-boun...@open-mpi.org wrote on 03/25/2009 07:34:06 PM: > [image removed] > > Re: [OMPI users] MPI_Test without deallocation > > Shaun Jackman > > to: > > Open MPI Users > > 03/25/2009 07:35 PM > > Sent by: > > users-boun...@open-mpi.org > > Please respond to Open MPI Users > > If an MPI_Irecv has already been posted, and a single message is sent > to the receiver, then will an MPI_Probe return that there is no > message waiting to be received? The message has already been received > by the MPI_Irecv. It's the MPI_Request object of the MPI_Irecv call > that needs to be probed, but MPI_Test has the side effect of also > deallocating the MPI_Request object. > > Cheers, > Shaun > > Justin wrote: > > Have you tried MPI_Probe? > > > > Justin > > > > Shaun Jackman wrote: > >> Is there a function similar to MPI_Test that doesn't deallocate the > >> MPI_Request object? I would like to test if a message has been > >> received (MPI_Irecv), check its tag, and dispatch the MPI_Request to > >> another function based on that tag. > >> > >> Cheers, > >> Shaun > _______________________________________________ > users mailing list > us...@open-mpi.org > http://www.open-mpi.org/mailman/listinfo.cgi/users