<!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.2802" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Dear All,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I am a newer for One Sided-Communcation. I have a
question how to create a window for 2D array. For example, I create a 2D double
array by this function:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>double** NewMPI2_2DPointer(int n1D, int
n2D)</FONT></DIV>
<DIV><FONT face=Arial size=2>{ double **pp;</FONT></DIV>
<DIV><FONT face=Arial size=2> int error;</FONT></DIV>
<DIV><FONT face=Arial size=2> error = MPI_Alloc_mem(n1D * sizeof(double*),
MPI_INFO_NULL, &pp);<BR> if (error !=
MPI_SUCCESS)<BR> {<BR> printf("Memory allocation
failed for PP 1D array, aborting.\n");<BR>
MPI_Abort(MPI_COMM_WORLD, -1);<BR> exit(-1);<BR>
}</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> for(i=0; i<n1D;
i++)<BR> {<BR> error = MPI_Alloc_mem(n2D *
sizeof(double), MPI_INFO_NULL, &pp[i]);<BR> if (error !=
MPI_SUCCESS)<BR> {<BR>
printf("Memory allocation failed for PP 1D array,
aborting.\n");<BR>
MPI_Abort(MPI_COMM_WORLD, -1);<BR>
exit(-1);<BR> }<BR> }</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>}</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I want to create a window for this
memory:</FONT></DIV>
<DIV><FONT face=Arial size=2>Like:</FONT></DIV>
<DIV><FONT face=Arial size=2> error = MPI_Win_create(pp,
n1D, sizeof(double*), MPI_INFO_NULL, MPI_COMM_WORLD, &win);<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>or should be</FONT></DIV>
<DIV><FONT face=Arial size=2> error = MPI_Win_create(pp,
n1D*n2D, sizeof(double), MPI_INFO_NULL, MPI_COMM_WORLD,
&win);<BR>
</FONT></DIV>
<DIV><FONT face=Arial size=2>Which is the right? Please tell me! THanks very
much!</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Tao</FONT></DIV></BODY></HTML>