[mpich-discuss] MPI_Waitsome question

Eric Hui Eric.Hui at ggy.com
Thu Jan 12 14:56:06 CST 2012


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/mpich-discuss/attachments/20120112/e45aea1f/attachment.htm>


More information about the mpich-discuss mailing list