Here are three runs of my program with debuggin output turned on. Each process prints out its rank followed by its portion of the array before and after the sort. Using the rank you can follow the sorted result in order.

The fist run is the default size, 10, with 4 processes. The second run is a smaller commandline specified size of 6, with 4 processes. The third run is the default size, 10, with 8 processes.

% mpirun -np 4 --hostfile hostfile ./oddevensort

Process 0: 313 752 689 848 901 478 352 365 218 799 
Process 1: 452 965 701 599 227 208 205   4 119 565 
Process 3:  34 719 759 960 802 671 387  98 101 378 
Process 2: 951 479 210 136  79 807 623 235 398 674 

Process 0:   4  34  79  98 101 119 136 205 208 210 
Process 3: 752 759 799 802 807 848 901 951 960 965 
Process 1: 218 227 235 313 352 365 378 387 398 452 
Process 2: 478 479 565 599 623 671 674 689 701 719 

% mpirun -np 4 --hostfile hostfile ./oddevensort 6

Process 3: 963 804 572  29 257 257 
Process 0: 923 730 596 396 217 347 
Process 2: 147 789 273 730 970 481 
Process 1: 785 540 162 148  78 669 

Process 0:  29  78 147 148 162 217 
Process 3: 785 789 804 923 963 970 
Process 1: 257 257 273 347 396 481 
Process 2: 540 572 596 669 730 730 

% mpirun -np 8 --hostfile hostfile ./oddevensort

Process 1:  58 776 516 826 777 546 640 560  63 111 
Process 2: 936 357  73 214 273 488 901 716   3 158 
Process 3: 432 801 114 635 670 547 763  70 343 965 
Process 7: 583 740 240 114 396 850 798  74 822 462 
Process 0:  25 971 277 745 593 102 387 524 726 439 
Process 4: 649 460 987 934 650 481 186 111 319 365 
Process 5: 613 659 847  45 806 517 780 895 901  20 
Process 6: 254 792 340  56  38 264 707  88 284  10 

Process 0:   3  10  20  25  38  45  56  58  63  70 
Process 1:  73  74  88 102 111 111 114 114 158 186 
Process 7: 847 850 895 901 901 934 936 965 971 987 
Process 5: 640 649 650 659 670 707 716 726 740 745 
Process 6: 763 776 777 780 792 798 801 806 822 826 
Process 3: 357 365 387 396 432 439 460 462 481 488 
Process 2: 214 240 254 264 273 277 284 319 340 343 
Process 4: 516 517 524 546 547 560 583 593 613 635 

# if this happened to print out in rank order, then
# the full sorted array of values is more obviously correct:

Process 0:   3  10  20  25  38  45  56  58  63  70 
Process 1:  73  74  88 102 111 111 114 114 158 186 
Process 2: 214 240 254 264 273 277 284 319 340 343 
Process 3: 357 365 387 396 432 439 460 462 481 488 
Process 4: 516 517 524 546 547 560 583 593 613 635 
Process 5: 640 649 650 659 670 707 716 726 740 745 
Process 6: 763 776 777 780 792 798 801 806 822 826 
Process 7: 847 850 895 901 901 934 936 965 971 987