I am coding an MPI fortran program and have, let say, three vectors of different length in three ranks. I would like to combine them together in a "concatenate" way such as:
Rank 0: a0 = [1 2 3 4 5]
Rank 1: a1 = [3 5 7 9]
Rank 2: a2 = [2 4 6 8 10 12]
Combine them to:
Rank 0: a = [1 2 3 4 5 3 5 7 9 2 4 6 8 10 12]
Could you please tell me how I can do that ?