Boost logo

Boost Users :

Subject: Re: [Boost-users] mpi: sending/receiving different types
From: Riccardo Murri (riccardo.murri_at_[hidden])
Date: 2010-12-07 03:20:17


On Mon, Dec 6, 2010 at 6:01 PM, Hicham Mouline <hicham_at_[hidden]> wrote:
> About the broadcast() function, I obviously have many types of messages to send, would you rather:
>
> 1. send a broadcast with just an int (like a tag) to tell which broadcast is following next
>
> or
>
> 2. construct a virtual base class my_mpi_broadcast , derive all the sendable broadcasts from it, from sender, send actual instance of derived from my_mpi_broadcast, and at receiver, can the mechanism reconstruct for me the derived class? (with boost::serialization)
>

I'm not sure I understand this question: mpi::broadcast() works like a
send+recv in one call: one MPI rank (the *root*) sends, the others
receive.

Any data that is allowed in send() can be used in a broadcast(); in
particular, if you have classes with Serialization support, you send()
or broadcast() them with no additional effort.

Best regards,
Riccardo


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net