# PetscParallelSortedInt
Check whether a `PetscInt` array, distributed over a communicator, is globally sorted. 
## Synopsis
```
#include "petscsys.h"  
PetscErrorCode PetscParallelSortedInt(MPI_Comm comm, PetscInt n, const PetscInt keys[], PetscBool *is_sorted)
```
Collective


## Input Parameters

- ***comm -*** the MPI communicator
- ***n -*** the local number of integers
- ***keys -*** the local array of integers



## Output Parameters

- ***is_sorted -*** whether the array is globally sorted





## See Also
 `PetscParallelSortInt()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/utils/sorti.c.html#PetscParallelSortedInt">src/sys/utils/sorti.c</A>


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