Hi Jack,

On Wed, Aug 4, 2010 at 6:25 AM, Jack Bryan <dtustud...@hotmail.com> wrote:
> I need to transfer some data, which is C++ class with some vector<float>
> member data.
> I want to use MPI_Bcast(buffer, count, datatype, root, comm);
> May I use MPI_Datatype to define customized data structure that contain C++
> class ?

No, unless you have access to the implementation details of the
std::vector class (which would render your code dependent on one
particular implementation of the STL, and thus non-portable).

Boost.MPI provides support for std C++ datatypes; if you want to keep
to "plain MPI" calls, then your only choice is to use C-style arrays.

Regards,
Riccardo

Reply via email to