<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7036.0">
<TITLE>RE: [mpich-discuss] Please help me</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2> 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).<BR>
<BR>
(PS: Boost MPI internally uses derived MPI datatypes to serialize your classes.)<BR>
Regards,<BR>
Jayesh<BR>
<BR>
-----Original Message-----<BR>
From: mpich-discuss-bounces@mcs.anl.gov [<A HREF="mailto:mpich-discuss-bounces@mcs.anl.gov">mailto:mpich-discuss-bounces@mcs.anl.gov</A>] On Behalf Of Jeff Squyres<BR>
Sent: Friday, August 07, 2009 12:45 PM<BR>
To: mpich-discuss@mcs.anl.gov<BR>
Subject: Re: [mpich-discuss] Please help me<BR>
<BR>
You might also want to look into the Boost.mpi project. They handle the magic of sending and receiving of STL datatypes.<BR>
<BR>
<BR>
On Aug 7, 2009, at 1:41 PM, Dorian Krause wrote:<BR>
<BR>
> Okay, as I said before sending a single vector is not hard, you just<BR>
> need to<BR>
><BR>
> 1. Create a derived datatype for AGENT using MPI_Type_struct 2. Call<BR>
> MPI_Send(&agent[0][0], ...)<BR>
><BR>
> If you now want to send all the 100 vectors at once you could<BR>
><BR>
> 1. Create a derived datatype for AGENT using MPI_Type_struct 2. Create<BR>
> a derived datatype for your array of vectors to account for the class<BR>
> header stuff which is in between the data; again MPI_Type_struct might<BR>
> do the trick ...<BR>
><BR>
> I never used nested derived datatypes and can not comment on the<BR>
> performance of this approach. I always like to use derived datatypes<BR>
> but simply copying data to a contiguous buffer is also a possibility<BR>
> if memory is not a concern here ...<BR>
><BR>
> Hope this helps.<BR>
> Dorian<BR>
><BR>
><BR>
> Vineet Pratap (Vampaier) wrote:<BR>
> ><BR>
> > Yes i have 100 vectors that i want to sent all at once. And all<BR>
> vector<BR>
> > are different length.............<BR>
> > vector <AGENT> agent[100];<BR>
> > where AGENT is class object that contain int,char data types..<BR>
> > --<BR>
> > VINEET PRATAP<BR>
> > (09868366605)<BR>
> > &<BR>
> > (09995211212)<BR>
><BR>
><BR>
<BR>
<BR>
--<BR>
Jeff Squyres<BR>
jsquyres@cisco.com<BR>
<BR>
</FONT>
</P>
</BODY>
</HTML>