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进程,那就会自动接收了!

该函数的调用经初步测试,也是阻塞式的,所以可以放心使用
posted @ 2011-05-04 15:52  super119  阅读(1584)  评论(0编辑  收藏  举报