---
name: "MPI_Register_datarep_c"
section: "3"
platform: "linux"
package: "mpich-doc"
version: "4.0.2-3"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/MPI_Register_datarep_c"
---

# MPI\_Register\_datarep\_c(3)

Register functions for user-defined data representations

## NAME

MPI\_Register\_datarep\_c -  Register functions for user-defined data representations

## SYNOPSIS

```
int MPI_Register_datarep_c(ROMIO_CONST char *datarep,
MPI_Datarep_conversion_function_c * read_conversion_fn,
MPI_Datarep_conversion_function_c * write_conversion_fn,
MPI_Datarep_extent_function * dtype_file_extent_fn, void *extra_state)
```

## INPUT PARAMETERS

- **datarep**

  \- data representation name (string)

- **read\_conversion\_fn**

  \- function invoked to convert from file representation to native representation (function)

- **write\_conversion\_fn**

  \- function invoked to convert from native representation to file representation (function)

- **dtype\_file\_extent\_fn**

  \- function invoked to get the exted of a datatype as represented in the file (function)

- **extra\_state**

  \- pointer to extra state that is passed to each of the three functions

## NOTES

This function allows the user to provide routines to convert data from an external representation, used within a file, and the native representation, used within the CPU.  There is one predefined data representation, *external32* . Please consult the MPI-2 standard for details on this function.

## NOTES FOR FORTRAN

All MPI routines in Fortran (except for  *MPI\_WTIME* and  *MPI\_WTICK* ) have an additional argument  *ierr* at the end of the argument list.   *ierr* is an integer and has the same meaning as the return value of the routine in C.  In Fortran, MPI routines are subroutines, and are invoked with the *call* statement.

All MPI objects (e.g.,  *MPI\_Datatype* ,  *MPI\_Comm* ) are of type  *INTEGER* in Fortran.
