mpi_probe()用于确定消息大小
MPI_Probe 的常见用途是确定传入消息的大小,以便为接收缓冲区分配足够的内存。但这也可以通过一对单独的 MPI_Send-MPI_Recv 调用来完成,即发送方进程在不同的消息中将消息大小发送到接收方。是否可以假设 MPI_Probe 通常是更快的选项?为什么?我们可以执行一些测试并比较挂机时间,但结果可能取决于实现。
A common usage of MPI_Probe is in determining the size of an incoming message so that enough memory is allocated for the receive buffer. But this can also be done with a separate pair of MPI_Send-MPI_Recv calls, i.e. the sender process sends the message size to the receiver in a different message. Can it be assumed that MPI_Probe is in general the faster option? Why? We can perform some tests and compare the walltimes, but the results may be implementation-dependent.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
MPI_ANY_SOURCE
变得更加容易:否则您必须首先确定大小消息的来源,然后从该源执行特定的接收。人们经常使用
MPI_Iprobe
来代替MPI_Probe
,它会告诉您是否有消息。是的,您可以使用多个 Irecv 来模拟它,但为什么要使代码如此复杂呢?MPI_ANY_SOURCE
as a sender: otherwise you'd have to first determine where the size msg comes from, and then do a specific receive from that source.Instead of
MPI_Probe
, people often doMPI_Iprobe
which tells you if there is a message at all. Yes, you can emulate that with multipleIrecv
s, but why would you make your code so complicated?