[mpich-discuss] MPI_Waitsome question

Rajeev Thakur thakur at mcs.anl.gov
Thu Jan 12 15:56:40 CST 2012


There is no receive posted in your code snippet.

Rajeev

On Jan 12, 2012, at 2:56 PM, Eric Hui wrote:

> Hi,
>  
> Is there a way to cancel or wake up the MPI_Waitsome function once it’s been called?
>  
> I have three threads in my MFC application.
>  
> One thread is for doing calculation.  The second thread is for processing windows and MPI messages.  The third thread is simply calling MPI_Waitsome to check for incoming messages and then posting it to the second thread to be processed.
>  
> At the end of the program, the second thread wants to wake up the third thread from the MPI_Waitsome call by sending it a dummy message. 
>  
> However, this approach doesn’t seem to work as I have created a one thread message with the following code snippet and it’s stuck in the MPI_Waitsome call.
>  
>    int Dummy = 0;
>  
>    MPI_Isend(&Dummy, 1, MPI_INT, 0, 0, MPI_COMM_SELF, &SelfRequest);
>  
>    MPI_Request array_of_requests[1];
>  
>    array_of_requests[0] = SelfRequest;
>  
>    int outcount = 0;
>  
>    int array_of_indices[1];
>  
>    array_of_indices[0] = 0;
>  
>    if (MPI_Waitsome (1, array_of_requests, &outcount, array_of_indices, MPI_STATUSES_IGNORE) == MPI_SUCCESS)
>    {
>       printf ("MPI_Waitsome succeeded");
>    }
>    else
>    {
>       printf ("MPI_Waitsome failed");
>    }
>  
> Any suggestion on how to resolve this issue would be much appreciated!
>  
> Eric Hui
> GGY AXIS
> 416-2503448
> Eric.Hui at ggy.com
>  
> _______________________________________________
> mpich-discuss mailing list     mpich-discuss at mcs.anl.gov
> To manage subscription options or unsubscribe:
> https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss



More information about the mpich-discuss mailing list