Friend,
             I can not specify the rank of the sender. Because only the sender knows to which receiver the message is to be sent. The receiver does not know from which sender the message will come. I am trying to do a research work on load balancing in MPI application where load is redistributed, so in that I require a receiver to receive a load value from a sender that it does not know. On the other hand, the sender actually calculates, to which receiver this load value should be sent. So for this, I want sender to send a message containing the load to a receiver, but receiver does not know from which sender the message will come. See, it is like send receiver in DATAGRAM sockets. The receiver, receives the message on the IP and port, the message which was directed for it. I want to have same behavior. But it seems that it is not possible in MPI. Isn't it?

regards,
Mudassar


From: Jeff Squyres <jsquyres@cisco.com>
To: Mudassar Majeed <mudassarm30@yahoo.com>
Cc: Open MPI Users <users@open-mpi.org>
Sent: Friday, July 15, 2011 3:30 AM
Subject: Re: [OMPI users] Urgent Question regarding, MPI_ANY_SOURCE.

Right.  I thought you were asking about receiving *another* message from whomever you just received from via ANY_SOURCE.

If you want to receive from a specific sender, you just specify the rank you want to receive from -- not ANY_SOURCE.

You will always only receive messages that were sent to *you*.  There's no MPI_SEND_TO_ANYONE_WHO_IS_LISTENING functionality, for example.  So your last statement: "But when it captures with .. MPI_ANY_SOURCE and MPI_ANY_TAG, the receiver will capture any message (even not targetted for it)" is incorrect.

I guess I still don't understand your question...?


On Jul 14, 2011, at 9:17 PM, Mudassar Majeed wrote:

>
> I know this, but when I compare status.MPI_SOURCE with myid, they are different. I guess you need to reconsider my question. The MPI_Recv function seems to capture message from the queue with some search parameters like source, tag etc. So in case the receiver does not know the sender and wants to receive only that message which was sent for this receiver. But when it captures with source as MPI_ANY_SOURCE and MPI_ANY_TAG, the receiver will capture any message (even not targetted for it).
>
> regards,
> Mudassar
>
>
> From: Jeff Squyres <jsquyres@cisco.com>
> To: Mudassar Majeed <mudassarm30@yahoo.com>; Open MPI Users <users@open-mpi.org>
> Sent: Friday, July 15, 2011 1:58 AM
> Subject: Re: [OMPI users] Urgent Question regarding, MPI_ANY_SOURCE.
>
> When you use MPI_ANY_SOURCE in a receive, the rank of the actual sender is passed back to you in the status.MPI_SOURCE.
>
> On Jul 14, 2011, at 7:55 PM, Mudassar Majeed wrote:
>
> > Hello people,
> >                        I am trapped in the following problem plz help me. Suppose a process A sends a message to process B. The process B will receive the message with MPI_Recv with MPI_ANY_SOURCE in the source argument. Let say process B does not know that A is the sender. But I want B to receive message from process A (the one who actually sends the message to process B). But if I use MPI_ANY_SOURCE, then any message from any source is captured by process B (let say there are other processes sending messages). Instead of MPI_ANY_SOURCE I cannot use A in the source argument as B does not know about the sender. What should I do in this situation ?
> >
> > regards,
> > Mudassar Majeed
> > _______________________________________________
> > users mailing list
> > users@open-mpi.org
> > http://www.open-mpi.org/mailman/listinfo.cgi/users
>
>
> --
> Jeff Squyres
> jsquyres@cisco.com
> For corporate legal information go to:
> http://www.cisco.com/web/about/doing_business/legal/cri/
>
>
>


--
Jeff Squyres
jsquyres@cisco.com
For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/