MPI_Bcast deadlock

爷,独闯天下 提交于 2019-12-01 14:43:48

mpi_bcast should be called by all processes in the communicator and they should all encounter the call at the same point in the code. As you have written your (pseudo-)code the root process makes a call to broadcast which the worker processes do not, and the worker processes make a call which the root does not.

mpi_bcast is one of MPI's collective routines, the library takes care of determining the correct pattern of message sending based on the arguments you pass to it. In the case of mpi_bcast the 4th argument is the id of the source of the broadcast (it doesn't need to be the root process of the communicator though it often is); all the other processes in the communicator will be receivers.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!