[MPICH] MPI-IO and Create_indexed datatype

Rob Ross rross at mcs.anl.gov
Thu Apr 12 22:16:11 CDT 2007


Hi Russell,

You've got a few options.

If floats and ints are the same size in this case, you could just 
consider them as 4*MPI_BYTEs and use your indexed type.

Or you could create a struct that describes a header, then create an 
indexed type of those. Probably you will want to use an hindexed type 
instead, so that you can give offsets in bytes rather than in extents.

Does this help?

Rob

Russell L. Carter wrote:
> Hi,
> I want to use collective Read_all and Write_all to a
> multi-zone structured file which has a header for each
> zone in which all of the fields save exactly one are
> homogeneous floating point types.  The one field is an int.
> Each zone may have arbitrary dimensions but is otherwise
> consistently structured.  (This is an OVERFLOW Q file)
> 
> Reading in Section 3.4.5 of "Using MPI-2" I got the
> idea that possibly Datatype::Create_indexed might be
> applicable, but it seems from what I can infer from the
> various documentation sources that the displacements
> vector is populated with extents, not byte offsets.  Thus
> apparently Create_indexed won't work because of that
> single int field, which precludes using extents.  Do
> I understand the situation correctly?  Is there a
> best practices approach for implementing higher level
> operations with this sort of data layout?
> 
> Thanks very much,
> Russell
> 
> 




More information about the mpich-discuss mailing list