MPI 中的条件广播
我想编写一个MPI程序,每个过程都有一个布尔值启动
最初设置为false。然后,排名0检查大型2D布尔数组的值(i
,j
)是正确的 ture。如果启动
的等级0的值是正确的,那么我希望等级0将启动
的新值广播到其他过程,间接告诉他们每个过程以启动另一种方法的执行。
我该如何有效地做到这一点?很高兴听到任何想法。
- 谢谢
PS。我考虑过将2D布尔数组发送到每个过程,但是在某些情况下,2D阵列可以非常很大,我担心我的代码不会很好地扩展。
I want to write an MPI Program where each process has a boolean value initiate
which is initially set to false. Then, rank 0 checks if the value (i
,j
) of a large 2D Boolean Array is true and if it is then rank 0 sets its value of initiate
to true. If rank 0's value of initiate
is true then I would like rank 0 to broadcast the new value of initiate
to other processes, indirectly telling each of them to kickstart execution of another method.
How could I go about doing this efficiently? Would appreciate to hear any ideas.
-Thanks
PS. I considered sending the 2d boolean array to every process, but that 2d array can be very big under certain circumstances and I am worried that my code would not scale well.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我假设您想利用等待时间。详细阐述 Gilles Gouaillardet 的评论,您可以构建一种“中断”类型的结构。
I assume you want to make use of the wait time. Elaborating on Gilles Gouaillardet's comment, you can build an "interrupt" kind of structure.