[mpich-discuss] Question on MPI_Type_create_struct

Dorier, Matthieu mdorier at anl.gov
Thu Oct 1 10:40:08 CDT 2015


Ok thanks Rajeev.

I came up with this problem when trying to read multiple blocks of a 3d array in a file, with overlapping blocks. I was creating a set of MPI_Datatypes using the MPI_Type_create_subarray, and combining these types using MPI_Type_create_struct, passing the result to MPI_File_set_view.

If you have any suggestion on how to (easily) use collective I/O in a context where each process has a set of blocks to load from a big 3d array (blocks can overlap within and across processes, due to ghost zones), I'm all listening.

Thanks,

Matthieu 
________________________________________
From: Thakur, Rajeev [thakur at mcs.anl.gov]
Sent: Thursday, October 01, 2015 10:34 AM
To: discuss at mpich.org
Subject: Re: [mpich-discuss] Question on MPI_Type_create_struct

No, the file offsets represented by the file view must be "monotonically nondecreasing” (3.1, 492:5-6). You can do the permutation instead in the datatype describing memory buffer in the read call. No restrictions on that datatype.

Rajeev


> On Oct 1, 2015, at 10:10 AM, Dorier, Matthieu <mdorier at anl.gov> wrote:
>
> (I meant "ACBD" in the first case, not "ACDB")
>
> From: Dorier, Matthieu [mdorier at anl.gov]
> Sent: Thursday, October 01, 2015 10:03 AM
> To: discuss at mpich.org
> Subject: [mpich-discuss] Question on MPI_Type_create_struct
>
> Hi,
>
> Suppose I have a file containing "ABCD", I build a type that would let me read "AC" and another type allowing me to read "BD". Can I then create a struct type using MPI_Type_create_struct combining the 2 types, and use it in an MPI_File_set_view such that if I then read 4 bytes on the file, I get "ACDB" in my buffer?
>
> If so, another more complicated scenario: say my first type would let me read "ACD" from the file and the second type would allow me to read "BC", can I then build a struct type using those two types, use it in an MPI_File_set_view to get "ACDBC" if I read 5 bytes?
>
> Thanks,
>
> Matthieu
> _______________________________________________
> discuss mailing list     discuss at mpich.org
> To manage subscription options or unsubscribe:
> https://lists.mpich.org/mailman/listinfo/discuss

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


More information about the discuss mailing list