Mpi Scatter是否以任何顺序发送数据

Does Mpi Scatter send data in any kind of order

我在网上看到这个

MPI_Scatter takes an array of elements and distributes the elements in the order of process rank.

但是我在文档中找不到它。

我有一个数组,有4个进程。一个进程是 root -> 将在其他 3 个进程中分散数据。 id-s 是 0, 1, 2, 3.

问题:MPI_Scatter()MPI_Scatterv()会按顺序发送数据吗?

示例 1:

0: [a, b, c, d, e]

// after scatter

1: [a, b]
2: [c, d]
3: [e]

示例 2:

0: [a, b]

// after scatter

1: [a]
2: [b]
3: [ ]

另外,gather 做同样的事情吗? (保留顺序)

顺序保证按照MPI_Comm中的排名.

以下语句是从 open-mpi v2.1 文档中复制粘贴的:

An alternative description is that the root sends a message with MPI_Send(sendbuf, sendcount * n, sendtype, ...). This message is split into n equal segments, the ith segment is sent to the ith process in the group, and each process receives this message as above. The send buffer is ignored for all nonroot processes.