gpt4 book ai didi

mpi - MPI_Allgather 和 MPI_Allgatherv 的区别

转载 作者:行者123 更新时间:2023-12-04 17:27:33 48 4
gpt4 key购买 nike

MPI_Allgather()有什么区别和 MPI_Allgatherv() ?

最佳答案

来自 MPI standard

MPI_GATHERV extends the functionality of MPI_GATHER by allowing a varying count of data from each process, since recvcounts is now an array. It also allows more flexibility as to where the data is placed on the root, by providing the new argument, displs



MPI_ALLGATHERV 是它的扩展。

这两个函数的签名是
int MPI_Allgather(void * sendbuff, int sendcount, MPI_Datatype sendtype, 
void * recvbuf, int recvcount, MPI_Datatype recvtype,
MPI_Comm comm)
int MPI_Allgatherv(void * sendbuff, int sendcount, MPI_Datatype sendtype,
void * recvbuf, int * recvcounts, int * displs,
MPI_Datatype recvtype, MPI_Comm comm)

您可以使用 recvcounts 为每个进程的数据指定大小和目标偏移量。和 displs使用 v 变体。

关于mpi - MPI_Allgather 和 MPI_Allgatherv 的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5865553/

48 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com