[mpich-discuss] Please help me

Jeff Squyres jsquyres at cisco.com
Fri Aug 7 12:45:17 CDT 2009


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



More information about the mpich-discuss mailing list