Globally sort a distributed array of integers
mapin - PetscLayout describing the distribution of the input keys
mapout - PetscLayout describing the distribution of the output keys
keysin - the pre-sorted array of integers
keysout - the array in which the sorted integers will be stored. If mapin == mapout, then keysin may be equal to keysout.
Notes: This implements a distributed samplesort, which, with local array sizes n_in and n_out, global size N, and global number of processes P, does#
chooses pivots by sorting (in parallel) (P-1) pivot suggestions from each process using bitonic sort and allgathering a subset of (P-1) of those
using to the pivots to repartition the keys by all-to-all exchange
sorting the repartitioned keys locally (the array is now globally sorted, but does not match the mapout layout)
redistributing to match the mapout layout
If keysin != keysout, then keysin will not be changed during PetscParallelSortInt.