<div>Well, shared-mem and sending 0 byte does not work if the processes are on differnt boxes. My thought is that since MPICH already make the dicission on wheter to use shared memory. It is a nature fit that the 'no copy' rule be applied in that domain.</div> <div> </div> <div>thanks</div> <div>tan</div> <div><BR><BR><B><I>Darius Buntinas <buntinas@mcs.anl.gov></I></B> wrote:</div> <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid"><BR><BR>On 10/08/2007 01:38 PM, chong tan wrote:<BR>> I am interested in the case that the send and recieve buffer are the <BR>> same buffer allocated from shared-memory, in which case there is no need <BR>> for the data copying, send and recieve just only do the sync.<BR><BR>In this case, why not use a zero-byte message? The sender fills in the <BR>shared buffer, does a write barrier, then calls MPI_Send with a <BR>zero-byte message. The receiver calls
MPI_Recv, to receive zero bytes, <BR>then when it returns, it does a read barrier and reads the data from the <BR>shared buffer.<BR><BR>> A side question, when MPI_Send is called, does MPICH copy the data into <BR>> a intermediate global buffer ? and have the data copy from this same <BR>> buffer on MPI_Recv call ?<BR><BR>It depends on the channel and what you're sending. For non-contiguous <BR>data, the data may be packed into a contiguous buffer before sending and <BR>unpacked from a contiguous buffer when receiving. Otherwise, if a <BR>channel uses sockets, an intermediate buffer is not used by MPICH2, but <BR>the OS will perform intermediate copies. For a channel that uses a <BR>high-performance network, an intermediate buffer is used for small <BR>messages, but for large messages the data is transferred directly from <BR>or into the user's buffer.<BR><BR>-d<BR><BR>> tan<BR>> <BR>> <BR>> */Darius Buntinas <BUNTINAS@MCS.ANL.GOV>/* wrote:<BR>>
<BR>> <BR>> Well, you specify one buffer in the call to MPI_Send and another buffer<BR>> in MPI_Recv, so there would have to be at least one copy. You can't do<BR>> it without any copies (otherwise, how would the data get from the send<BR>> buffer to the receive buffer?).<BR>> <BR>> MPICH2 does support communication over shared memory (as opposed to<BR>> over<BR>> a network) which improves performance for intranode communication.<BR>> Configure with --with-device=ch3:ssm or --with-device=ch3:nemesis.<BR>> <BR>> Darius<BR>> <BR>> <BR>> On 10/08/2007 12:22 PM, chong tan wrote:<BR>> > If I the pointer passed to MPI_Send and MPI_Recieve are already<BR>> shared<BR>> > memory, and need not be copied at all ?<BR>> ><BR>> > If so, How ?<BR>> ><BR>> > thanks<BR>> > tan<BR>> ><BR>> ><BR>> ><BR>>
------------------------------------------------------------------------<BR>> > Be a better Heartthrob. Get better relationship answers<BR>> > from<BR>> > someone who knows.<BR>> > Yahoo! Answers - Check it out.<BR>> <BR>> <BR>> ------------------------------------------------------------------------<BR>> Need a vacation? Get great deals to amazing places <BR>> <HTTP: evt="48256/*http://travel.yahoo.com/;_ylc=X3oDMTFhN2hucjlpBF9TAzk3NDA3NTg5BHBvcwM1BHNlYwNncm91cHMEc2xrA2VtYWlsLW5jbQ--" us.rd.yahoo.com>on <BR>> Yahoo! Travel.<BR></BLOCKQUOTE><BR><p> 
<hr size=1>Boardwalk for $500? In 2007? Ha! <br><a href="http://us.rd.yahoo.com/evt=48223/*http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow">Play Monopoly Here and Now</a> (it's updated for today's economy) at Yahoo! Games.