[MPICH] MPI-IO and Create_indexed datatype

Russell L. Carter rcarter at esturion.net
Thu Apr 12 23:01:41 CDT 2007


Hi Rob,

Rob Ross wrote:
> 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.

Yeah, I thought of that, but it's important to support both 4 and
8 byte FP types.

Also, maybe writing a simple converter to modernize the format...
because who *really* cares that a small set of ints gets stored
in that format in a GiB of floating point data.

> 
> 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?

Why yes, I'm an MPI newbie, and it looks like Datatype::Create_hindexed does
what I need.  The docs at mpi-forum.org are a bit scattered,
Create_hindexed is not in the same section as Create_indexed, so it
takes a bit of clue to find it.

Thanks very much!
Russell

> 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
>>
>>


-- 
Russell L. Carter
Esturion, LLC
2285 Sandia Drive
Prescott, Arizona 86301

rcarter at esturion.net
928 308-4154




More information about the mpich-discuss mailing list