:orphan:
# PetscMPIIntCast
casts a `PetscInt` (which may be 64-bits in size) to a PetscMPIInt (which may be 32-bits in size), generates an error if the `PetscMPIInt` is not large enough to hold the number. 
## Synopsis
```
static inline PetscErrorCode PetscMPIIntCast(PetscInt a, PetscMPIInt *b)
```
Not Collective; No Fortran Support


## Input Parameter

- ***a -*** the `PetscInt` value



## Output Parameter

- ***b -*** the resulting `PetscMPIInt` value





## See Also
 `PetscBLASInt`, `PetscMPIInt`, `PetscInt`, `PetscBLASIntCast()`, `PetscIntCast()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/include/petscsys.h.html#PetscMPIIntCast">include/petscsys.h</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex48.c.html">src/snes/tutorials/ex48.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex14.c.html">src/ts/tutorials/ex14.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/include/petscsys.h)


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