Hi,<div>In the below code am trying to send an array from one processor to other processor.But Its giving error. I don't understand why its coming! pls help me in this.<div>(This code is working well without MPI_Send and MPI_Irecv statements).</div>
<div><br></div><div><div>int main(int argc, char*argv[]){</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>double *simulateRuns(int, int, int, int);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>double simulateOneRun(int,int,int);</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>void stat(double *,int);</div><div><br></div><div> int nprocs;<span class="Apple-tab-span" style="white-space:pre">                        </span> /* number of processes */</div>
<div> int rank,tag=1;<span class="Apple-tab-span" style="white-space:pre">                        </span> /* the unique identification of this process */</div><div> long int before,after;</div><div> double * profit1,* profit2,* profit;</div>
<div> int n=500,m=20000,s=80,S=200;</div><div> MPI_Status status;</div><div> before=GetTickCount();</div><div><br></div><div> MPI_Init (&argc, &argv);</div><div> MPI_Comm_rank (MPI_COMM_WORLD, &rank);</div>
<div> MPI_Comm_size (MPI_COMM_WORLD, &nprocs);</div><div> printf("rank=%d nproc=%d\n",rank,nprocs);</div><div><br></div><div> if (rank==0){</div><div> profit1=simulateRuns(n/nprocs,m,s,S);</div><div> stat(profit1,n/2);</div>
<div> MPI_Send(profit1,n/nprocs,MPI_DOUBLE,1,tag,MPI_COMM_WORLD);</div><div> }</div><div><br></div><div> if(rank==1){</div><div> profit2=simulateRuns(n/nprocs,m,s,S);</div><div> stat(profit2,n/2);</div><div> MPI_Irecv(profit,n/nprocs,MPI_DOUBLE,0,tag,MPI_COMM_WORLD,&status);</div>
<div> }</div><div><br></div><div> MPI_Finalize ();</div><div> after=GetTickCount();</div><div> printf("time elapsed=%ld\n",(after-before));</div><div>}</div><div><br></div><div><br></div><div>/* OUTPUT*/</div>
<div><div><br></div><div><div>C:\Users\Sankar\My Documents\visual studio 2008\Projects\Inventorympi\Debug>mpie</div><div>xec -n 2 Inventorympi.exe</div><div>Fatal error in MPI_Finalize: Other MPI error, error stack:</div>
<div>MPI_Finalize(318).........................: MPI_Finalize failed</div><div>MPI_Finalize(211).........................:</div><div>MPID_Finalize(92).........................:</div><div>PMPI_Barrier(476).........................: MPI_Barrier(comm=0x44000002) failed</div>
<div>MPIR_Barrier(82)..........................:</div><div>MPIC_Sendrecv(164)........................:</div><div>MPIC_Wait(513)............................:</div><div>MPIDI_CH3i_Progress_wait(215).............: an error occurred while handling an</div>
<div>event returned by MPIDU_Sock_Wait()</div><div>MPIDI_CH3I_Progress_handle_sock_event(420):</div><div>MPIDU_Sock_wait(2606).....................: The specified network name is no lon</div><div>ger available. (errno 64)</div>
<div>Fatal error in MPI_Recv: Other MPI error, error stack:</div><div>MPI_Recv(187).............................: MPI_Recv(buf=CCCCCCCC, count=250, MP</div><div>I_DOUBLE, src=0, tag=1, MPI_COMM_WORLD, status=0023F920) failed</div>
<div>MPIDI_CH3i_Progress_wait(215).............: an error occurred while handling an</div><div>event returned by MPIDU_Sock_Wait()</div><div>MPIDI_CH3I_Progress_handle_sock_event(455):</div><div>adjust_iov(825)...........................: ch3|sock|immedread 00566358 008B0FE8</div>
<div> 00FC0048</div><div>MPIDU_Sock_readv(2750)....................: An established connection was aborte</div><div>d by the software in your host machine. (errno 10053)</div></div></div><div><br></div><div><br></div><div>
Thank you</div><div><br></div><div><br></div></div></div>