[mpich-discuss] Please help me
Jayesh Krishna
jayesh at mcs.anl.gov
Fri Aug 7 12:53:11 CDT 2009
I would recommend using Boost MPI as Jeff mentioned in his previous
email. If you have arrays in your class you might run into problems with
Boost MPI version 1.39.0 (Try trunk - which has a fix to the problem OR a
version > 1.39.0).
(PS: Boost MPI internally uses derived MPI datatypes to serialize your
classes.)
Regards,
Jayesh
-----Original Message-----
From: mpich-discuss-bounces at mcs.anl.gov
[mailto:mpich-discuss-bounces at mcs.anl.gov] On Behalf Of Jeff Squyres
Sent: Friday, August 07, 2009 12:45 PM
To: mpich-discuss at mcs.anl.gov
Subject: Re: [mpich-discuss] Please help me
You might also want to look into the Boost.mpi project. They handle the
magic of sending and receiving of STL datatypes.
On Aug 7, 2009, at 1:41 PM, Dorian Krause wrote:
> Okay, as I said before sending a single vector is not hard, you just
> need to
>
> 1. Create a derived datatype for AGENT using MPI_Type_struct 2. Call
> MPI_Send(&agent[0][0], ...)
>
> If you now want to send all the 100 vectors at once you could
>
> 1. Create a derived datatype for AGENT using MPI_Type_struct 2. Create
> a derived datatype for your array of vectors to account for the class
> header stuff which is in between the data; again MPI_Type_struct might
> do the trick ...
>
> I never used nested derived datatypes and can not comment on the
> performance of this approach. I always like to use derived datatypes
> but simply copying data to a contiguous buffer is also a possibility
> if memory is not a concern here ...
>
> Hope this helps.
> Dorian
>
>
> Vineet Pratap (Vampaier) wrote:
> >
> > Yes i have 100 vectors that i want to sent all at once. And all
> vector
> > are different length.............
> > vector <AGENT> agent[100];
> > where AGENT is class object that contain int,char data types..
> > --
> > VINEET PRATAP
> > (09868366605)
> > &
> > (09995211212)
>
>
--
Jeff Squyres
jsquyres at cisco.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/mpich-discuss/attachments/20090807/230ddf88/attachment.htm>
More information about the mpich-discuss
mailing list