[mpich-discuss] Please help me
    Dorian Krause 
    ddkrause at uni-bonn.de
       
    Fri Aug  7 12:41:09 CDT 2009
    
    
  
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)
    
    
More information about the mpich-discuss
mailing list