Re: Canonical

Leslie Hart (hart@nipmuc.fsl.noaa.gov)
Wed, 12 Feb 1997 16:56:35 -0700 (MST)

>
> > So what are the alignment rules. If there are alignment rules, what is the
> > FILE_EXTENT of MPI_BYTE and the FILE_EXTENT of 4*MPI_BYTE?
>
> I don't quite understand what you're asking here. The alignment rules are
> pretty much what you would assume they might be; objects of size N bytes must
> usually be N-byte aligned, but nothing more restrictive than 8-byte alignment
> is ever needed. I think.
>

What I'm trying to get at here is a potential problem that exists with XDR. If
MPI_BYTE is packed as an OPAQUE data type, then 1 byte occupies 4 bytes of
space, as does 2 bytes, as does 3 and 4 bytes. If you are reading one byte,
then you probably use the basic data type of MPI_BYTE. If you are reading 4
bytes, you can issue 4 separate reads of MPI_BYTE or one read of a derived
contiguous data type of 4 MPI_BYTES -- I believe it is possible for these to be
different under XDR. Also, if you are trying to seek over a 3 byte header you
cannot seek 3 * MPI_FILE_EXTENT (..., MPI_BYTE, ...), you have to seek
MPI_FILE_EXTENT (..., MY_4_BYTE_DATATYPE, ...).

Leslie
> ...snip...
> --
> Eric Salo Silicon Graphics Inc. salo@sgi.com
>