now Cycling

There are still two errors:
1.For example, process 0 has 2 elements(1 2), process 1 has 3 elements(3 4 5),when 0 transfer array to 1, the output by process 1 will be wrong as 1 2 5. 
2.Now the N is 9, when I use -np 2 or 3, program is right, but when I use more processes there would be error about MPI_Waitall.