MPI_BCAST函数的探讨

MPI_Bcast - Broadcast a message from the process with rank "root" to all other processes of the group

int MPI_Bcast(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm)

整个函数的收发过程是这样,如果要发送一个广播信息,那么将root这个参数填成该进程的id号即可完成发送,在其他进程如果要接收的话,也是用这个函数,此时进程会检查root参数和自身的进程ID号,如果发现自己不是root进程,那就会自动接收了!

该函数的调用经初步测试,也是阻塞式的,所以可以放心使用
原文地址:https://www.cnblogs.com/super119/p/2036589.html