<!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>&nbsp;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 &gt; 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.&nbsp; 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>
&gt; Okay, as I said before sending a single vector is not hard, you just<BR>
&gt; need to<BR>
&gt;<BR>
&gt; 1. Create a derived datatype for AGENT using MPI_Type_struct 2. Call<BR>
&gt; MPI_Send(&amp;agent[0][0], ...)<BR>
&gt;<BR>
&gt; If you now want to send all the 100 vectors at once you could<BR>
&gt;<BR>
&gt; 1. Create a derived datatype for AGENT using MPI_Type_struct 2. Create<BR>
&gt; a derived datatype for your array of vectors to account for the class<BR>
&gt; header stuff which is in between the data; again MPI_Type_struct might<BR>
&gt; do the trick ...<BR>
&gt;<BR>
&gt; I never used nested derived datatypes and can not comment on the<BR>
&gt; performance of this approach. I always like to use derived datatypes<BR>
&gt; but simply copying data to a contiguous buffer is also a possibility<BR>
&gt; if memory is not a concern here ...<BR>
&gt;<BR>
&gt; Hope this helps.<BR>
&gt; Dorian<BR>
&gt;<BR>
&gt;<BR>
&gt; Vineet Pratap (Vampaier) wrote:<BR>
&gt; &gt;<BR>
&gt; &gt; Yes i have 100 vectors that i want to sent all at once. And all<BR>
&gt; vector<BR>
&gt; &gt; are different length.............<BR>
&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vector &lt;AGENT&gt; agent[100];<BR>
&gt; &gt; where AGENT is class object that contain int,char data types..<BR>
&gt; &gt; --<BR>
&gt; &gt; VINEET PRATAP<BR>
&gt; &gt; (09868366605)<BR>
&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &amp;<BR>
&gt; &gt; (09995211212)<BR>
&gt;<BR>
&gt;<BR>
<BR>
<BR>
--<BR>
Jeff Squyres<BR>
jsquyres@cisco.com<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>