No problem, I'll make that change.  I also just realized that I need to
improve the documentation in parallel.h for the string case.  It says in
there that the user is responsible for resizing the receiving array, but
that isn't true for this version of the overload.

Cody


On Mon, Apr 8, 2013 at 7:24 AM, Benjamin S. Kirk
<notifications@github.com>wrote:

> In include/parallel/parallel_implementation.h:
>
> > +    }
> > +
> > +  libmesh_assert_less (root_id, this->size());
> > +
> > +  START_LOG("broadcast()", "Parallel");
> > +
> > +  std::size_t bufsize=0;
> > +  if (root_id == this->rank())
> > +    {
> > +      for (std::size_t i=0; i<data.size(); ++i)
> > +        bufsize += data[i].size() + 1;  // Add one for the string length byte
> > +    }
> > +  this->broadcast(bufsize, root_id);
> > +
> > +  // Pack the strings
> > +  std::vector<short int> temp; temp.reserve(bufsize);
>
> @perm <https://github.com/perm> & @roystgnr <https://github.com/roystgnr>- shouldn't this be some 'meta type' that is guaranteed to be bigger than ?
>
> I know I'm being pedantic, but conceivably this could be called with a
> wchar_t or even a char32_t.
>
> I'd say either
>
>    1. just make temp a std::vector because latency will probably trump
>    bandwidth for all conceivable use cases, or
>    2. assert that sizeof(T) <= sizeof(short int)
>
> -Ben
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/libMesh/libmesh/pull/77/files#r3693827>
> .
>