Gather receives messages of _one_ length. Hence all arrays has to be of
same length (not exactly see below). Hence 625 should be 175.
See the example on the documentation site:
https://www.open-mpi.org/doc/v1.8/man3/MPI_Gather.3.php
You should use gatherv for varying length of messages, or use gat
Gather requires that all processes contribute the same size message. Gatherv
allows the root to specify a different size that will be supplied by each peer
process.
Note, too, that X1(iStart:iEnd) may well invoke a copy to copy just that
portion of the array; that might hurt your performance (
dear all,
I am not sure if I have understood correctly mpi_gather and mpi_gatherv.
This is my problem:
I have a complex vector, let's say: X1, where X1 is (1:625).
Each CPU work only with some element of X1, let say:
CPU 0 --> X1(iEnd-iStart) 150 elements
CPU 1 --> X1(iEnd-iStart) 150 element