On Mon, 18 Aug 2014, John Peterson wrote:

> On Mon, Aug 18, 2014 at 8:58 AM, John Peterson <jwpeter...@gmail.com> wrote:
>> On Mon, Aug 18, 2014 at 8:33 AM, Derek Gaston <fried...@gmail.com> wrote:
>>> You're right - it doesn't... I misread my old code... I missed my own
>>> packing/unpacking of the coordinates from/to Points (read them out into a
>>> flat array, broadcast(), recreate Points).
>>>
>>> So - never mind.  I guess I'll do the same thing again for now.
>>>
>>> How tough would it be to make this work with Point?
>>
>> Looks like it involves template magic and defining custom MPI types?

Pretty much.  It involves template magic and custom MPI types that
should be 95% there already, though; I'll take a crack at adding
whatever's missing this afternoon.

>>> Or should I be using allgather_packed_range() for this instead (would that 
>>> work as is?).
>>
>> That looks pretty close to what you want, actually...  It looks like
>> it takes a generic "context" and uses an std::inserter object for
>> unpacking.
>>
>> Here's an example from mesh_communication.C on Node*s...
>>
>> mesh.comm().allgather_packed_range (&mesh,
>>                                         mesh.nodes_begin(),
>>                                         mesh.nodes_end(),
>>                                         mesh_inserter_iterator<Node>(mesh)) :
>
> Actually the more I looked into it, it appears that
> allgather_packed_range is fairly specific to working with a Mesh
> object... so if you just have a vector<Point> you'd like to
> allgather(), it doesn't seem to be a viable choice.

allgather_packed_range doesn't need to be Mesh specific - that mesh
pointer is a generic "context" pointer, necessary for any cases where
you're also packing data that isn't directly carried with the objects
(in this case boundary info).

But all the packed_range code is inefficient for anything that doesn't
require packing.  With Elem/Node there's data (that boundary info, dof
indices, neighbor pointers etc) that's variable size, so serializing
is tricky.  With Point you get 3*sizeof(Real) bytes regardless, so it
should be preferable to use the simpler methods.
---
Roy

------------------------------------------------------------------------------
_______________________________________________
Libmesh-devel mailing list
Libmesh-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to