DeinoMPI

The Great and Terrible implementation of MPI-2

function index

MPI_Register_datarep

Register 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
);

Parameters

name
[in] data representation name (string)
read_conv_fn
[in] function invoked to convert from file representation to native representation (function)
write_conv_fn
[in] function invoked to convert from native representation to file representation (function)
extent_fn
[in] function invoked to get the exted of a datatype as represented in the file (function)
extra_state
[in] pointer to extra state that is passed to each of the three functions

Remarks

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 implementation, and
    2. a user wants to read a file written in a representation unknown to the implementation.
User-defined data representations allow the user to insert a third party converter into the I/O stream to do the data representation conversion.

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.

Example Code

The following sample code illustrates MPI_Register_datarep.

Insert code here.