On Mon, Dec 6, 2010 at 6:01 PM, Hicham Mouline
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