parallel processing - Scattered indices in MPI -
i'm trying divide array between processors such each 1 takes points different parts in array. example, if a = {1, 2, 3, 4, 5, 6, 7, 8} and i'm using 2 processors, want p 1 handle {1, 3, 5, 7} , , p 2 handle {2, 4, 6, 8} . when scaling large numbers of points (millions) , processors (128), tricky. in previous versions of function, gave p 1 first chunk of points, p 2 next chunk, , on (which easy mpi_gatherv ). is there way use mpi_gatherv make work, or way use mpi_send , mpi_receive achieve it? trouble mpi_gatherv while can specify indices processors send to, still puts of p 1 before p 2 before p 3 etc.