阻塞 MPI_Scatter 死锁

发布于 2025-01-20 09:12:45 字数 467 浏览 1 评论 0原文

在 W. Gropp 等人的《Using Advanced MPI》一书中。 (有关非阻塞集体的第 19 页)内容如下:

“由于循环匹配顺序依赖性,所有四个通信器同时进行的任何阻塞集体操作都会导致死锁......”

根据书中的说法,这段代码会死锁:

MPI_Comm comm[5]= {c_my, c_north, c_south, c_east, c_west}
for (i=0; i<5; ++i) {
  MPI_Scatter(sbf[i], ct, dt, rbf[i], ct, dt, 0, comm[i]);
}

我知道 MPI_Scatter 是一个阻塞操作,因此当第一次迭代 (i=0) MPI_Scatter 被称为它之后阻塞,并且只有当它完成时,程序流程才会继续,并且执行下一次迭代,而不会产生死锁。

我想我错过了什么?谢谢。

in the book Using Advanced MPI by W. Gropp et al. (page 19 on Non-blocking Collectives) it reads:

"Any blocking collective operation on all four communicators at the same time would lead to a deadlock because of the cyclic matching ordering dependency ..."

According to the book this code would deadlock:

MPI_Comm comm[5]= {c_my, c_north, c_south, c_east, c_west}
for (i=0; i<5; ++i) {
  MPI_Scatter(sbf[i], ct, dt, rbf[i], ct, dt, 0, comm[i]);
}

I understood that MPI_Scatter is a blocking operation, thus when in the first iteration (i=0) MPI_Scatter is called it blocks afterward, and only when it is done the program's flow continues and the next iteration is executed without creating a deadlock.

I guess I am missing something? Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文