Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] Does sendrecv guarantee order?
From: Jeff Squyres (jsquyres) (jsquyres_at_[hidden])
Date: 2014-02-14 07:06:44


On Feb 13, 2014, at 10:59 PM, Saliya Ekanayake <esaliya_at_[hidden]> wrote:

> Anyway, to answer your question I was trying to do sendrecv in a chain where "toSend" and "receiveFrom" ranks are not the same. I was using a single buffer, which resulted in cases where the buffer content got replaced with received values before being able to send its original content. I think it was an error on my side to use a single buffer in a pipeline sendrecev. I fixed it by having two buffers.

That is correct: MPI_SENDRECV does not guarantee any ordering.

> I guess still with MPI_IN_PLACE this could happen. Please correct me here if I am wrong.

That is also correct. You could, however, use MPI_SENDRECV_REPLACE. It's not much more efficient than providing your own two buffers (i.e., OMPI will alloc a temporary receive buffer, and when the send is done, it'll copy from the temp to the send buffer).

-- 
Jeff Squyres
jsquyres_at_[hidden]
For corporate legal information go to: http://www.cisco.com/web/about/doing_business/legal/cri/