As far as I know, since your struct contains a pointer, I don’t believe you have a choice other than to pack. 

 

Someone can correct me if I’m wrong.

 

Thanks,

 

Raghu

 

 

 

From: discuss-bounces@mpich.org [mailto:discuss-bounces@mpich.org] On Behalf Of Mahesh Doijade
Sent: Thursday, March 21, 2013 4:42 AM
To: mpich-discuss@mcs.anl.gov
Subject: Re: [mpich-discuss] Query regarding structure of dynamic array derived datatype

 

Hi,
     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.
      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?


--

Regards,
-- Mahesh Doijade

On Thu, Mar 21, 2013 at 2:36 AM, Pavan Balaji <balaji@mcs.anl.gov> wrote:


Please look through the derived datatype constructs in MPI.  Google can
help you find some tutorials.

 -- Pavan


On 03/19/2013 06:12 AM US Central Time, Mahesh Doijade wrote:
> Hi,
>      I have a struct as -
> struct A
> {
>     int size;
>     int *lptr;
> };
>      And then I have array of such structure, I want to only send
> dynamic array present in each of the structs to other process.
> One of the options is to do it with MPI_Pack but then I have read it is
> not so good from performance point of view.
> What can be the other opt
>
> --
>
> Regards,
> -- Mahesh Doijade
>
>
>
>
>

> _______________________________________________
> discuss mailing list     discuss@mpich.org
> To manage subscription options or unsubscribe:
> https://lists.mpich.org/mailman/listinfo/discuss
>

--
Pavan Balaji
http://www.mcs.anl.gov/~balaji