[MPICH] MPI-IO and Create_indexed datatype

Rob Ross rross at mcs.anl.gov
Fri Apr 13 10:15:08 CDT 2007


Russell L. Carter wrote:
> 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.

I'll leave it to you to decide if changing the format is reasonable :).

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

No problem. Be aware that on some systems the MPI_Aint that you use to 
describe the offsets in an hindexed type may be only 32 bits, so you may 
run into overflow problems. We can talk about how to work around that 
too if you like.

Rob




More information about the mpich-discuss mailing list