<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.hoenzb
        {mso-style-name:hoenzb;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>As far as I know, since your struct contains a pointer, I don’t believe you have a choice other than to pack.  <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Someone can correct me if I’m wrong.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Thanks,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Raghu<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> discuss-bounces@mpich.org [mailto:discuss-bounces@mpich.org] <b>On Behalf Of </b>Mahesh Doijade<br><b>Sent:</b> Thursday, March 21, 2013 4:42 AM<br><b>To:</b> mpich-discuss@mcs.anl.gov<br><b>Subject:</b> Re: [mpich-discuss] Query regarding structure of dynamic array derived datatype<o:p></o:p></span></p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'>Hi,<br>     Thanks for your reply, after looking at various MPI derived datatype creation functions other than MPI_Pack according to me option can probably be of using MPI_Type_create_struct but then for each structure element I have to create a separate derived datatype as the block lengths will be different due to dynamic array present in them, so again the extra memory will be required now for type-maps of these datatypes.<br>      Is the approach of MPI_Type_create_struct mentioned above will be better than MPI_Pack in this case?  also is there any other optimal way to do this?<br><br clear=all><br>-- <br><br>Regards,<br>-- Mahesh Doijade<o:p></o:p></p><div><p class=MsoNormal>On Thu, Mar 21, 2013 at 2:36 AM, Pavan Balaji <<a href="mailto:balaji@mcs.anl.gov" target="_blank">balaji@mcs.anl.gov</a>> wrote:<o:p></o:p></p><p class=MsoNormal><br>Please look through the derived datatype constructs in MPI.  Google can<br>help you find some tutorials.<br><br> -- Pavan<o:p></o:p></p><div><div><p class=MsoNormal><br>On 03/19/2013 06:12 AM US Central Time, Mahesh Doijade wrote:<br>> Hi,<br>>      I have a struct as -<br>> struct A<br>> {<br>>     int size;<br>>     int *lptr;<br>> };<br>>      And then I have array of such structure, I want to only send<br>> dynamic array present in each of the structs to other process.<br>> One of the options is to do it with MPI_Pack but then I have read it is<br>> not so good from performance point of view.<br>> What can be the other opt<br>><br>> --<br>><br>> Regards,<br>> -- Mahesh Doijade<br>><br>><br>><br>><br>><o:p></o:p></p></div></div><p class=MsoNormal>> _______________________________________________<br>> discuss mailing list     <a href="mailto:discuss@mpich.org">discuss@mpich.org</a><br>> To manage subscription options or unsubscribe:<br>> <a href="https://lists.mpich.org/mailman/listinfo/discuss" target="_blank">https://lists.mpich.org/mailman/listinfo/discuss</a><br>><br><span style='color:#888888'><br><span class=hoenzb>--</span><br><span class=hoenzb>Pavan Balaji</span><br><span class=hoenzb><a href="http://www.mcs.anl.gov/%7Ebalaji" target="_blank">http://www.mcs.anl.gov/~balaji</a></span></span><o:p></o:p></p></div><p class=MsoNormal><br><br>                                                                           <o:p></o:p></p></div></body></html>