[mpich-discuss] Semantics of MPI_Cancel

Wesley Bland wbland at mcs.anl.gov
Wed Aug 7 22:57:43 CDT 2013


I might be reading this differently then everyone else, but it appears that you're asking which SEND would be matched, not which RECEIVE. Assuming you use the same communicator, tag, and recipient, messages in MPI are always guaranteed to be in order. So if you manage to cancel the Irecv in time, you'll receive the first send in the Recv and the second send will be waiting to be matched. There isn't a situation where you'd receive message number 2 before message number 1 or not receive message 1 at all.

Wesley  


On Wednesday, August 7, 2013 at 7:16 PM, Matthieu Dorier wrote:

> Ah great, thanks!
>  
> Matthieu
>  
> ----- Mail original -----
> > De: "Rajeev Thakur" <thakur at mcs.anl.gov (mailto:thakur at mcs.anl.gov)>
> > À: discuss at mpich.org (mailto:discuss at mpich.org)
> > Envoyé: Mercredi 7 Août 2013 16:34:18
> > Objet: Re: [mpich-discuss] Semantics of MPI_Cancel
> >  
> > MPI_Cancel will succeed only if the receive can be canceled, i.e.,
> > not part of the message has already been received into the receive
> > buffer. So, if the cancel succeeds, the send will match the next
> > receive. You have to check the error code returned by cancel.
> >  
> > On Aug 7, 2013, at 4:18 PM, Matthieu Dorier wrote:
> >  
> > > So either there is no way to know which MPI_Send will be matched,
> > > since even with
> > > MPI_Irecv(req); MPI_Test(flag,req); if(!flag) {MPI_Cancel(req)}
> > > MPI_Recv()
> > > the MPI_Irecv could have completed between the MPI_Test and the
> > > MPI_Cancel...
> > >  
> > > Or does the content of the MPI_Irecv, which is supposed to have
> > > been put in the user-provided buffer, gets transferred into the
> > > buffer of the next MPI_Recv upon cancellation of the MPI_Irecv?
> > >  
> > > Thanks,
> > >  
> > > Matthieu
> > >  
> > > ----- Mail original -----
> > > > De: "Rajeev Thakur" <thakur at mcs.anl.gov (mailto:thakur at mcs.anl.gov)>
> > > > À: discuss at mpich.org (mailto:discuss at mpich.org)
> > > > Envoyé: Mercredi 7 Août 2013 16:10:02
> > > > Objet: Re: [mpich-discuss] Semantics of MPI_Cancel
> > > >  
> > > > You canceled the recv, not the send. The send will still go
> > > > through
> > > > and match the first available receive that can be matched.
> > > >  
> > > > On Aug 7, 2013, at 3:25 PM, Matthieu Dorier wrote:
> > > >  
> > > > > Hi,
> > > > >  
> > > > > Suppose process 0 does the following
> > > > > MPI_Irecv(...req)
> > > > > MPI_Cancel(req)
> > > > > MPI_Recv
> > > > >  
> > > > > and process 1 does
> > > > > MPI_Send
> > > > > MPI_Send
> > > > >  
> > > > > Does process 0 receives the data from the first or the second
> > > > > MPI_Send?
> > > > > (I'd tend to say the second, but I'd like a confirmation).
> > > > >  
> > > > > Thanks!
> > > > >  
> > > > > Matthieu Dorier
> > > > > PhD student at ENS Cachan Brittany and IRISA
> > > > > http://people.irisa.fr/Matthieu.Dorier
> > > > > _______________________________________________
> > > > > discuss mailing list discuss at mpich.org (mailto:discuss at mpich.org)
> > > > > To manage subscription options or unsubscribe:
> > > > > https://lists.mpich.org/mailman/listinfo/discuss
> > > > >  
> > > >  
> > > >  
> > > > _______________________________________________
> > > > discuss mailing list discuss at mpich.org (mailto:discuss at mpich.org)
> > > > To manage subscription options or unsubscribe:
> > > > https://lists.mpich.org/mailman/listinfo/discuss
> > > >  
> > >  
> > > _______________________________________________
> > > discuss mailing list discuss at mpich.org (mailto:discuss at mpich.org)
> > > To manage subscription options or unsubscribe:
> > > https://lists.mpich.org/mailman/listinfo/discuss
> > >  
> >  
> >  
> > _______________________________________________
> > discuss mailing list discuss at mpich.org (mailto:discuss at mpich.org)
> > To manage subscription options or unsubscribe:
> > https://lists.mpich.org/mailman/listinfo/discuss
> >  
>  
> _______________________________________________
> discuss mailing list discuss at mpich.org (mailto:discuss at mpich.org)
> To manage subscription options or unsubscribe:
> https://lists.mpich.org/mailman/listinfo/discuss
>  
>  


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mpich.org/pipermail/discuss/attachments/20130807/98a26ff9/attachment.html>


More information about the discuss mailing list