MPI_Register_datarepRegister functions for user-defined data representations
int MPI_Register_datarep( char *name, MPI_Datarep_conversion_function *read_conv_fn, MPI_Datarep_conversion_function *write_conv_fn, MPI_Datarep_extent_function *extent_fn, void *state ); int MPI_Register_datarep( wchar_t *name, MPI_Datarep_conversion_function *read_conv_fn, MPI_Datarep_conversion_function *write_conv_fn, MPI_Datarep_extent_function *extent_fn, void *state );
- [in] data representation name (string)
- [in] function invoked to convert from file representation to native representation (function)
- [in] function invoked to convert from native representation to file representation (function)
- [in] function invoked to get the exted of a datatype as represented in the file (function)
- [in] pointer to extra state that is passed to each of the three functions
There are two situations that cannot be handled by the required representations:
1. a user wants to write a file in a representation unknown to the
2. a user wants to read a file written in a representation unknown to the implementation.
The call associates read_conversion_fn, write_conversion_fn, and dtype_file_extent_fn with the data representation identifier datarep. datarep can then be used as an argument to MPI_FILE_SET_VIEW, causing subsequent data access operations to call the conversion functions to convert all data items accessed between file data representation and native representation. MPI_REGISTER_DATAREP is a local operation and only registers the data representation for the calling MPI process. If datarep is already defined, an error in the error class MPI_ERR_DUP_DATAREP is raised using the default file error handler. The length of a data representation string is limited to the value of MPI_MAX_DATAREP_STRING. MPI_MAX_DATAREP_STRING must have a value of at least 64. No routines are provided to delete data representations and free the associated resources; it is not expected that an application will generate them in significant numbers.
The following sample code illustrates MPI_Register_datarep.
Insert code here.