[MPICH] Passing class in C++ MPI

Yann Golanski yann at kierun.org
Fri Apr 21 04:43:31 CDT 2006

Quoth Pankaj Gupta on Thu, Apr 20, 2006 at 14:06:23 -0400
>     I am trying to parallelize a distributed simulation written in C++ having
> several classes. After reading several books, online manuals, and this mailing
> list, I still could not figure out a way to pass the class data from node 0 to
> all the processors or vice-versa. I came across other possible approaches such
> as MPI_Pack/Unpack or creating a string of the class data.
> My question is: Is it possible to pass a classes in C++ MPI (MPICH)? Any
> example, suggestions, or alternative approach will really help me.

Yes, I've had the same problem.  Attached is some code I have done.  It
should work for you as well.
You will need Boost to use it.  But then again, you should use Boost

yann at kierun.org                  -=*=-                      www.kierun.org
    PGP:   009D 7287 C4A7 FD4F 1680  06E4 F751 7006 9DE2 6318
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mpi_wrapper.cc
Type: text/x-c++src
Size: 2367 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/mpich-discuss/attachments/20060421/b9a61d79/attachment.cc>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/mpich-discuss/attachments/20060421/b9a61d79/attachment.pgp>

More information about the mpich-discuss mailing list