# PetscMPIErrorString
Given an MPI error code returns the `MPI_Error_string()` appropriately formatted for displaying with the PETSc error handlers. 
## Synopsis
```
#include "petscsys.h" 
void PetscMPIErrorString(PetscMPIInt err, char *string)
```

## Input Parameter

- ***err -*** the MPI error code



## Output Parameter

- ***string -*** the MPI error message, should declare its length to be larger than `MPI_MAX_ERROR_STRING`





## Note
Does not return an error code or do error handling because it may be called from inside an error handler


## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/error/err.c.html#PetscMPIErrorString">src/sys/error/err.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/error/err.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)  
