mpi/serialization: broadcast function and the value argument
Following a suggestion from another thread, I have tried broadcasting in a polymorphic way. I have a hierarchy of polymorphic struct (they have 2 virtual functions). I was wondering if it was possible/allowed to root process: base* b; /// b points to an actual derived struct but may also point the base struct (not abstract) broadcast( ..., b, ...); slave processes: base* b; broadcast( ..., b, ...); /// broadcast constructs the appropriate struct and makes b point to where it did that assuming all the conditions for pointer to class conditions are satisfied for the serialization library. Otherwise, perhaps a solution with a boost::variant over the base struct and all of its derived is the way to go? Thanks,
On Dec 8, 2010, at 5:50 PM, Hicham Mouline wrote:
Following a suggestion from another thread, I have tried broadcasting in a polymorphic way.
I have a hierarchy of polymorphic struct (they have 2 virtual functions). I was wondering if it was possible/allowed to
root process: base* b; /// b points to an actual derived struct but may also point the base struct (not abstract) broadcast( ..., b, ...);
slave processes: base* b; broadcast( ..., b, ...); /// broadcast constructs the appropriate struct and makes b point to where it did that
assuming all the conditions for pointer to class conditions are satisfied for the serialization library.
If serialization works on your polymorphic class then this should work as well. Matthias
participants (2)
-
Hicham Mouline
-
Matthias Troyer