<div>Well, shared-mem and sending 0 byte does not work if the processes are on differnt boxes.&nbsp; My thought is that since MPICH already make the dicission on wheter to use shared memory.&nbsp; It is a nature fit that the 'no copy' rule be applied in that domain.</div>  <div>&nbsp;</div>  <div>thanks</div>  <div>tan</div>  <div><BR><BR><B><I>Darius Buntinas &lt;buntinas@mcs.anl.gov&gt;</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>&gt; I am interested in the case that the send and recieve buffer are the <BR>&gt; same buffer allocated from shared-memory, in which case there is no need <BR>&gt; 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>&gt; A side question, when MPI_Send is called, does MPICH copy the data into <BR>&gt; a intermediate global buffer ? and have the data copy from this same <BR>&gt; 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>&gt; tan<BR>&gt; <BR>&gt; <BR>&gt; */Darius Buntinas <BUNTINAS@MCS.ANL.GOV>/* wrote:<BR>&gt;
 <BR>&gt; <BR>&gt; Well, you specify one buffer in the call to MPI_Send and another buffer<BR>&gt; in MPI_Recv, so there would have to be at least one copy. You can't do<BR>&gt; it without any copies (otherwise, how would the data get from the send<BR>&gt; buffer to the receive buffer?).<BR>&gt; <BR>&gt; MPICH2 does support communication over shared memory (as opposed to<BR>&gt; over<BR>&gt; a network) which improves performance for intranode communication.<BR>&gt; Configure with --with-device=ch3:ssm or --with-device=ch3:nemesis.<BR>&gt; <BR>&gt; Darius<BR>&gt; <BR>&gt; <BR>&gt; On 10/08/2007 12:22 PM, chong tan wrote:<BR>&gt; &gt; If I the pointer passed to MPI_Send and MPI_Recieve are already<BR>&gt; shared<BR>&gt; &gt; memory, and need not be copied at all ?<BR>&gt; &gt;<BR>&gt; &gt; If so, How ?<BR>&gt; &gt;<BR>&gt; &gt; thanks<BR>&gt; &gt; tan<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt;
 ------------------------------------------------------------------------<BR>&gt; &gt; Be a better Heartthrob. Get better relationship answers<BR>&gt; &gt; from<BR>&gt; &gt; someone who knows.<BR>&gt; &gt; Yahoo! Answers - Check it out.<BR>&gt; <BR>&gt; <BR>&gt; ------------------------------------------------------------------------<BR>&gt; Need a vacation? Get great deals to amazing places <BR>&gt; <HTTP: evt="48256/*http://travel.yahoo.com/;_ylc=X3oDMTFhN2hucjlpBF9TAzk3NDA3NTg5BHBvcwM1BHNlYwNncm91cHMEc2xrA2VtYWlsLW5jbQ--" us.rd.yahoo.com>on <BR>&gt; Yahoo! Travel.<BR></BLOCKQUOTE><BR><p>&#32;



      <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.