The type matching rules for I/O mimic the type matching rules for communication with one exception: if etype is MPI_BYTE, then this matches any datatype in a data access operation. In general, the etype of data items written must match the etype used to read the items, and for each data access operation, the current etype must also match the type declaration of the data access buffer.
Advice to users.
In most cases, use of MPI_BYTE as a wild card will
defeat the file interoperability features of MPI.
File interoperability can only perform automatic conversion
between heterogeneous data representations when the exact datatypes
accessed are explicitly specified.
( End of advice to users.)