mpi: sending/receiving different types
Hi, I will be sending messages of different kinds. The destination will not know what kind of message it is trying to receive. Imagine I send many messages of the same kind. I understand the tag in send/receive will be different in each case? Or can I send 2 messages of the same king with the same tag? That way the receiver can use the tag to identify what it is it is receiving. If so, is the receiver supposed to use the recv() function with different template argument T until the call succeeds ? Or should I always use packed_<oi>archive? rds,
Hi Hicham -
You should look into probe(). I the result of a probe will give you a
valid MPI_Status, which contains the tag and source. You can use this
tag to determine how you can construct an appropriate recv().
Brian
On Thu, Dec 2, 2010 at 11:49 PM, Hicham Mouline
Hi,
I will be sending messages of different kinds.
The destination will not know what kind of message it is trying to receive.
Imagine I send many messages of the same kind. I understand the tag in send/receive will be different in each case? Or can I send 2 messages of the same king with the same tag? That way the receiver can use the tag to identify what it is it is receiving. If so, is the receiver supposed to use the recv() function with different template argument T until the call succeeds ?
Or should I always use packed_<oi>archive?
rds,
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of Brian Budge Sent: 03 December 2010 16:34 To: boost-users@lists.boost.org Subject: Re: [Boost-users] mpi: sending/receiving different types
On Thu, Dec 2, 2010 at 11:49 PM, Hicham Mouline
wrote: Hi,
I will be sending messages of different kinds.
The destination will not know what kind of message it is trying to receive.
Imagine I send many messages of the same kind. I understand the tag in send/receive will be different in each case? Or can I send 2 messages of the same king with the same tag? That way the receiver can use the tag to identify what it is it is receiving. If so, is the receiver supposed to use the recv() function with different template argument T until the call succeeds ?
Or should I always use packed_<oi>archive?
rds, Hi Hicham -
You should look into probe(). I the result of a probe will give you a valid MPI_Status, which contains the tag and source. You can use this tag to determine how you can construct an appropriate recv().
Brian
If from the root process I both mpi::broadcast() and mpi::send(), will a receiver process be able to use probe() to see if a message that was either sent or broadcast is available? How can I do that? rds,
The way we do this is send a special message saying that a broadcast
will be sent next.
Brian
On Sun, Dec 5, 2010 at 4:44 AM, Hicham Mouline
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of Brian Budge Sent: 03 December 2010 16:34 To: boost-users@lists.boost.org Subject: Re: [Boost-users] mpi: sending/receiving different types
On Thu, Dec 2, 2010 at 11:49 PM, Hicham Mouline
wrote: Hi,
I will be sending messages of different kinds.
The destination will not know what kind of message it is trying to receive.
Imagine I send many messages of the same kind. I understand the tag in send/receive will be different in each case? Or can I send 2 messages of the same king with the same tag? That way the receiver can use the tag to identify what it is it is receiving. If so, is the receiver supposed to use the recv() function with different template argument T until the call succeeds ?
Or should I always use packed_<oi>archive?
rds, Hi Hicham -
You should look into probe(). I the result of a probe will give you a valid MPI_Status, which contains the tag and source. You can use this tag to determine how you can construct an appropriate recv().
Brian
If from the root process I both mpi::broadcast() and mpi::send(), will a receiver process be able to use probe() to see if a message that was either sent or broadcast is available?
How can I do that?
rds,
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
On 5 Dec 2010, at 07:44, Hicham Mouline wrote:
Hi Hicham -
You should look into probe(). I the result of a probe will give you a valid MPI_Status, which contains the tag and source. You can use this tag to determine how you can construct an appropriate recv().
Brian
If from the root process I both mpi::broadcast() and mpi::send(), will a receiver process be able to use probe() to see if a message that was either sent or broadcast is available?
probe() checks only for messages sent by send(), not by broadcast(). Matthias
participants (3)
-
Brian Budge
-
Hicham Mouline
-
Matthias Troyer