-----Original Message----- From: Matthias Troyer [mailto:troyer@phys.ethz.ch] Sent: 14 December 2010 17:57 <snip>
mpi::broadcast() appears to be incapable of sending the argument
"value" in a polymorphic way, ie:
sender------------------- Base* base; If I call boost::mpi::broadcast(..., base, ...)
receiver----------------- Base* base; boost::mpi::broadcast(..., base, ...) This does not construct the most derived type of base on the heap
and make base point there, as serialization would do.
Did you register the most derived type? Yes I have all types.
Did you test whether pointer deserialization works with other serialization archives? Matthias
I will test.
This will be crucial. If it does not work with, e.g. text or binary archives then it will not work with serialization either.
Matthias
The attached works with serialization. I've also tested with the classes in my real case. However, looking at the implementation of mpi::broadcast, the receiver uses the "value" passed to it to store what it received. If value is a Base* that is not initialized, value[0], in particular, is used and that will never work, see mpi/collectives/broadcast.hpp line 48 ia >> values[i] Am i interpreting this incorrectly? Regards,