MPI_Bsend 和 MPI_Isend。它们如何工作?
使用缓冲发送和非阻塞发送我想知道它们如何以及是否在我的应用程序中实现新级别的并行性,最终生成线程。 想象一下,一个从进程生成大量数据并希望将其发送给主进程。我的想法是启动缓冲或非阻塞发送,然后立即开始计算下一个结果。
就在我必须发送新数据时,我会检查是否可以重用缓冲区。这将在我的应用程序中将 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正在寻找的是使用您自己的缓冲区 (
MPI_Isend
) 的非阻塞发送。无需担心线程 -ISend
应立即返回以让您继续你自己的代码。然后,您可以继续工作,并在传递给Isend
的MPI_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 anMPI_Wait
request on theMPI_Request
that you passed toIsend
. 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 throughMPI_Waitany
.