问题描述
我得到了稍微混了关于同步的概念 - 在阻断和放大器的情况下异步的;从这里非阻塞的操作(在的openmpi):
I got slightly mixed up regarding the concept of synchronous - asynchronous in the context of blocking & non blocking operations (in OpenMPI) from here:
-
:MPI_Isend为不一定异步(?所以它可以同步)
link 1: MPI_Isend is not necessarily asynchronous ( so it can synchronous ?)
),但均无济于事我。
据我所知:
I have already gone through the previous sync - async - blocking - non blocking questions on stackoverflow (asynchronous vs non-blocking), but were of no help to me.As far as i know :
- Immidiate (MPI_ISEND)方法返回&安培;执行下一行 - >非阻塞
- 标准/非即时(MPI_SEND):适用于大型消息阻塞,直到传输完成
- A 同步操作块(的)
- 的异步操作是非阻塞(的)
- Immidiate ( MPI_ISEND): method returns & executes next line -> nonblocking
- Standard/non-immediate ( MPI_SEND) : for large messages it blocks until transfer completes
- A synchronous operation blocks (http://www.cs.unc.edu/~dewan/242/s07/notes/ipc/node9.html)
- An asynchronous operation is non-blocking (http://www.cs.unc.edu/~dewan/242/s07/notes/ipc/node9.html)
因此,如何与放大器;为什么MPI_ISEND可以阻断(联系1)以及非阻挡(联系2)?
i.e.what由异步和放大器的意思;这里同步MPI_ISEND?
so how & why MPI_ISEND may be blocking (link 1) as well as non blocking (link 2) ?i.e.what is meant by asynchronous & synchronous MPI_ISEND here ?
类似的困惑就出现&MPI_SSEND放大器; MPI_ISSEND,因为在取值在MPI_的取值发送意味着同步(或阻塞),并且: -
Similar confusion arises regarding MPI_SSEND & MPI_ISSEND, since the S in MPI_SSEND means synchronous(or blocking ) and:-
- MPI_SSEND :同步发送块,直到远程进程和放大器接收到的数据; ACK是
按发件人收到 - MPI_ISSEND :是指直接同步发送
- MPI_SSEND: synchronous send blocks until data is received on remote process & ack isreceived by sender,
- MPI_ISSEND: means immediate synchronous send
将我 mmediate是非阻塞的,
那么,如何才能MPI_的是发送是的取值 ynchronous&安培;返回的我 mmediately?
also the Immediate is non-blocking,So, how can MPI_ISSEND be Synchronous & return Immediately ?
我想是必要的异步和放大器更加清晰;同步在阻断和放大器的背景下;非阻塞的openmpi通信。
这方面的一个实际的例子或比喻将是非常有用的。
I guess more clarity is needed in asynchronous & synchronous in context of blocking & non blocking OpenMPI communication .A practical example or analogy in this regard will be very useful.
推荐答案
有当MPI函数调用返回(阻塞与非阻塞),当相应的操作完成(标准,同步,缓冲,现成的区别模式)。
There is a distinction between when MPI function calls return (blocking vs. non-blocking) and when the corresponding operation completes (standard, synchronous, buffered, ready-mode).
非阻塞调用 MPI_I ...
立即返回,无论在操作完成与否。该操作继续在后台,或异步。阻塞调用不返回,除非该操作已完成。非阻塞的操作是通过自己的手柄psented重新$ P $可能被用于执行阻塞等待( MPI_WAIT
)或非阻塞测试( MPI_TEST
)完成。
Non-blocking calls MPI_I...
return immediately, no matter if the operation has completed or not. The operation continues in the background, or asynchronously. Blocking calls do not return unless the operation has completed. Non-blocking operations are represented by their handle which could be used to perform a blocking wait (MPI_WAIT
) or non-blocking test (MPI_TEST
) for completion.
完成意味着所提供的数据缓冲器不再被通过MPI访问,因此,它可以被重新利用。发送该消息已被放任之后将其整体在网络上的缓冲器成为自由重用(包括在消息的一部分可能仍然由网络设备和/或驱动程序进行缓冲的情况下),或者已被某处缓冲MPI实现。缓冲的情况下,不需要接收器发布了一个匹配的接收操作,因此没有同步 - 接收可以在更晚的时间发布。阻塞同步发送 MPI_SSEND
不返回,除非接收器发布了一个接收操作,因此同步更新这两个行列。非阻塞同步发送 MPI_ISSEND
立即返回,但异步(后台)操作将不完整的,除非接收器发布了一个匹配的接收。
Completion of an operation means that the supplied data buffer is no longer being accessed by MPI and it could therefore be reused. Send buffers become free for reuse either after the message has been put in its entirety on the network (including the case where part of the message might still be buffered by the network equipment and/or the driver), or has been buffered somewhere by the MPI implementation. The buffered case does not require that the receiver has posted a matching receive operation and hence is not synchronising - the receive could be posted at a much later time. The blocking synchronous send MPI_SSEND
does not return unless the receiver has posted a receive operation, thus it synchronises both ranks. The non-blocking synchronous send MPI_ISSEND
returns immediately but the asynchronous (background) operation won't complete unless the receiver has posted a matching receive.
一个阻塞操作相当于一个非阻断一个紧跟一个等待。例如:
A blocking operation is equivalent to a non-blocking one immediately followed by a wait. For example:
MPI_Ssend(buf, len, MPI_TYPE, dest, tag, MPI_COMM_WORLD);
相当于:
MPI_Request req;
MPI_Status status;
MPI_Issend(buf, len, MPI_TYPE, dest, tag, MPI_COMM_WORLD, &req);
MPI_Wait(&req, &status);
标准的发送( MPI_SEND
/ MPI_ISEND
)一旦消息已建成和数据缓冲区的规定完成第一个参数可能会被重复使用。没有同步的保证 - 消息可能会被本地或远程缓冲。对于大多数的实现,通常有一些大小阈值:达到该大小的消息获得一段时间的消息被同步发送缓冲。阈值是依赖于实现的。
The standard send (MPI_SEND
/ MPI_ISEND
) completes once the message has been constructed and the data buffer provided as its first argument might be reused. There is no synchronisation guarantee - the message might get buffered locally or remotely. With most implementations, there is usually some size threshold: messages up to that size get buffered while longer messages are sent synchronously. The threshold is implementation-dependent.
缓冲发送总是缓冲消息转换成一个用户提供的中间缓冲器,基本上执行更复杂的存储器复制操作。间的粘连( MPI_BSEND
)和非阻塞版本的差异( MPI_IBSEND
)是,前者没有返回之前的所有消息数据已经被缓存。
Buffered sends always buffer the messages into a user-supplied intermediate buffer, essentially performing a more complex memory copy operation. The difference between the blocking (MPI_BSEND
) and the non-blocking version (MPI_IBSEND
) is that the former does not return before all the message data has been buffered.
就绪发送是一种非常特殊的操作。它仅成功完成,如果目的地排名已经发布的时候发送方不发送呼叫时接收操作。它可能通过消除需要执行某种握手的减少通信延迟
The ready send is a very special kind of operation. It only completes successfully if the destination rank has already posted the receive operation by the time when the sender makes the send call. It might reduce the communication latency by eliminating the need to performing some kind of a handshake.
这篇关于Immidiate VS在了openmpi同步通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!