MPI_Bsend 和 MPI_Isend。它们如何工作?

发布于 2024-10-21 03:57:31 字数 240 浏览 15 评论 0原文

使用缓冲发送和非阻塞发送我想知道它们如何以及是否在我的应用程序中实现新级别的并行性,最终生成线程。 想象一下,一个从进程生成大量数据并希望将其发送给主进程。我的想法是启动缓冲或非阻塞发送,然后立即开始计算下一个结果。

就在我必须发送新数据时,我会检查是否可以重用缓冲区。这将在我的应用程序中将 CPU 和通信之间的并行性提升到一个新的水平。有谁知道 MPI 中这是如何完成的? MPI 是否生成一个新线程来处理 Bsend 或 Isend ? 谢谢。

using buffered send and non blocking send I was wondering how and if they implement a new level of parallelism in my application eventually generating a thread.
Imagine that a slave process generates a large amount of data and want to send it to the master. My idea was to start a buffered or non blocking send then immediately begin to compute the next result.

Just when I would have to send the new data I wold check if I can reuse the buffer. This would introduce a new level of parallelism in my application between CPU and communication. Does anybody knows how this is done in MPI ? Does MPI generate a new thread to handle the Bsend or Isend ?
Thanks.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

罪歌 2024-10-28 03:57:31

您正在寻找的是使用您自己的缓冲区 (MPI_Isend) 的非阻塞发送。无需担心线程 - ISend 应立即返回以让您继续你自己的代码。然后,您可以继续工作,并在传递给 IsendMPI_Request 上发布 MPI_Wait 请求。然后,这将阻塞,直到缓冲区可以再次使用。如果您有多个缓冲区的空间,则可以通过分配多个缓冲区并使用通过 MPI_Waitany 可用的缓冲区来提高并行性。

What you're looking for is a nonblocking send using your own buffer (MPI_Isend).There is no need to worry about threading -- ISend should return immediately to let you continue your own code. You would then continue your work, and post an MPI_Wait request on the MPI_Request that you passed to Isend. This will then block until the buffer is free to use again. If you have space for several buffers, you could improve parallelism by allocating several buffers and using whichever becomes available through MPI_Waitany.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文