<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2900.5726" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>
<DIV><FONT size=2>Hi,</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; I want to send a data as pointer type in C 
to the other nodes. </FONT></DIV>
<DIV><FONT size=2>Is there any method to do so? I tried several times. 
</FONT><FONT size=2>But failed. </FONT></DIV>
<DIV><FONT size=2>Thanks a lot. </FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>PS: Purpose --&nbsp;make a variable which can be read and 
written by the other nodes.</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>My code is attached below:</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>#include &lt;stdlib.h&gt;<BR>#include 
&lt;string.h&gt;<BR>#include "mpi.h"</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>int main(int argc,char *argv[])<BR>{<BR>&nbsp;int myid, 
numprocs;<BR>&nbsp;<BR>&nbsp;double *ptr;<BR>&nbsp;double 
Q[1];<BR>&nbsp;Q[0]=1.3;<BR>&nbsp;Q[1]=7.3;<BR>&nbsp;<BR>&nbsp;MPI_Init(&amp;argc,&amp;argv);<BR>&nbsp;&nbsp;&nbsp; 
MPI_Comm_size(MPI_COMM_WORLD,&amp;numprocs);<BR>&nbsp;&nbsp;&nbsp; 
MPI_Comm_rank(MPI_COMM_WORLD,&amp;myid);<BR>&nbsp;<BR>&nbsp;if (myid == 0) 
{<BR>&nbsp;<BR>&nbsp;&nbsp;ptr = 
&amp;Q;<BR>&nbsp;&nbsp;MPI_Bcast((void*)&amp;ptr, 1, MPI_DOUBLE, 0, 
MPI_COMM_WORLD);<BR>&nbsp;&nbsp;printf("\n");<BR>&nbsp;&nbsp;printf("sizeof 
pointer %d\n", sizeof(ptr));<BR>&nbsp;&nbsp;printf("ptr has the value %p and is 
stored at %p\n", ptr, (void*)&amp;ptr);<BR>&nbsp;&nbsp;printf("The value of the 
integer pointed to by ptr is %f\n", *ptr);<BR>&nbsp;&nbsp;printf("Second address 
of ptr has the value %p and is valued at %f\n", ptr+1, 
*(ptr+1));<BR>&nbsp;&nbsp;<BR>&nbsp;}<BR>&nbsp;else{<BR>&nbsp;<BR>&nbsp;&nbsp;MPI_Bcast(ptr, 
1, MPI_DOUBLE, 0, 
MPI_COMM_WORLD);<BR>&nbsp;&nbsp;printf("\n");<BR>&nbsp;&nbsp;printf("ptr has the 
value %p and is stored at %p\n", ptr, 
(void*)&amp;ptr);<BR>&nbsp;&nbsp;printf("The value of the integer pointed to by 
ptr is %f\n", *ptr);<BR>&nbsp;&nbsp;printf("Second address of ptr has the value 
%p and is valued at %f\n", ptr+1, *(ptr+1));<BR>&nbsp;}</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;MPI_Finalize();<BR>&nbsp;&nbsp;&nbsp; return 
0;<BR>}</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>With all my best wishes.</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>Yours, Dongping Liu</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>Group M02<BR>State Key Laboratory of Magnetism<BR>Institute of 
Physics<BR>Chinese Academy of Sciences<BR>P.O.Box 603, Beijing 100190, P. R. 
China</FONT></DIV></FONT></DIV></BODY></HTML>