# PetscDataTypeToMPIDataType
Converts the PETSc name of a datatype to its MPI name. 
## Synopsis
```
#include "petscsys.h"    
PetscErrorCode PetscDataTypeToMPIDataType(PetscDataType ptype, MPI_Datatype *mtype)
```
Not collective


## Input Parameter

- ***ptype -*** the PETSc datatype name (for example `PETSC_DOUBLE`)



## Output Parameter

- ***mtype -*** the MPI datatype (for example `MPI_DOUBLE`, ...)





## See Also
 `PetscDataType`, `PetscMPIDataTypeToPetscDataType()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/objects/ptype.c.html#PetscDataTypeToMPIDataType">src/sys/objects/ptype.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/objects/ptype.c)


[Index of all Sys routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
