# PetscMPIIntSortSemiOrdered
Sorts an array of `PetscMPIInt` in place in increasing order. 
## Synopsis
```
#include "petscsys.h"  
PetscErrorCode PetscMPIIntSortSemiOrdered(PetscInt n, PetscMPIInt arr[])
```
Not Collective


## Input Parameters

- ***n   -*** number of values
- ***arr -*** array of `PetscMPIInt`



## Output Parameters

- ***arr -*** sorted array of integers



## Notes
If the array is less than 64 entries long `PetscSortMPIInt()` is automatically used.

This function serves as an alternative to `PetscSortMPIInt()`. While this function works for any array of `PetscMPIInt` it is
significantly faster if the array is not totally random. There are exceptions to this and so it is __highly__
recommended that the user benchmark their code to see which routine is fastest.




## See Also
 `PetscTimSort()`, `PetscSortMPIInt()`

## Level
intermediate

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


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