Collective Communication II

2.2 Scatterv
Extra capabilities in scatterv:
  • gaps allowed between messages in source data
  • (but individual messages must still be contiguous)
  • irregular message sizes allowed
  • data can be distributed to processes in any order
  • Scatterv

    MPI_Scatterv gives you extra capabilities that are most easily described by comparing this figure to the previous one. First of all, you can see that varying numbers of items are allowed to be sent to the different processors. What's more, the first item in each chunk doesn't have to be positioned at some regular spacing away from the first item of the previous chunk. And the chunks don't even have to be stored in the correct sequence! This is the flexibility I alluded to earlier. However, we have not done away with all the restrictions: the chunks themselves must still be contiguous, and they must not overlap with one another. (I will add here as a parenthetical note that if you really, really want to, you can insert spaces into a chunk by creating an MPI derived datatype that has some built-in stride. But that trick may carry with it a potentially severe penalty in efficiency, and the chunks still can't overlap.)