partition a 2D array column-wise and use allgather
问题 I have a fortran MPI code in which a compute intensive function is invoked on every element of a 2D array. I'm trying to split the tasks among the ranks. For example if there are 30 columns and 10 ranks, then each rank gets 3 columns. The following code does this split and gathers the results using allgather. But the final array doesn't have the values from all ranks. program allgather include 'mpif.h' !create a 2 x 30 myarray integer :: x=2,y=30 integer :: numprocs,myid integer :: i,j,k