<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>HI,</div><div><br></div><div>Given, MPI_Irecv(profit,n/nprocs,MPI_DOUBLE,0,tag,MPI_COMM_WORLD,&amp;status);</div><div><br></div><div>I wonder if you allocated memory in order to receive "profit".</div><div><br></div><div>profit = malloc (n/nprocs * sizeof(double));</div><div><br></div><br><div><div>El 11/05/2010, a las 19:33, Pavan Balaji escribió:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><br>MPI_Irecv needs to have a corresponding MPI_Wait. In your application, it might be easier to just replace it with MPI_Recv(), instead of MPI_Irecv().<br><br> -- Pavan<br><br>On 05/11/2010 11:58 AM, sankar s wrote:<br><blockquote type="cite">Hi,<br></blockquote><blockquote type="cite">In the below code am trying to send an array from one processor to other processor.But &nbsp;Its giving error. I don't understand why its coming! pls help me in this.<br></blockquote><blockquote type="cite">(This code is working well without MPI_Send and MPI_Irecv statements).<br></blockquote><blockquote type="cite">int main(int argc, char*argv[]){<br></blockquote><blockquote type="cite">double *simulateRuns(int, int, int, int);<br></blockquote><blockquote type="cite">double simulateOneRun(int,int,int);<br></blockquote><blockquote type="cite">void stat(double *,int);<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;int nprocs; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/* number of processes */<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;int rank,tag=1; &nbsp;&nbsp;&nbsp;/* the unique identification of this process */<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;long int before,after;<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;double * profit1,* profit2,* profit;<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;int n=500,m=20000,s=80,S=200;<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;MPI_Status status;<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;before=GetTickCount();<br></blockquote><blockquote type="cite"> &nbsp;MPI_Init (&amp;argc, &amp;argv);<br></blockquote><blockquote type="cite"> &nbsp;MPI_Comm_rank (MPI_COMM_WORLD, &amp;rank);<br></blockquote><blockquote type="cite"> &nbsp;MPI_Comm_size (MPI_COMM_WORLD, &amp;nprocs);<br></blockquote><blockquote type="cite"> &nbsp;printf("rank=%d &nbsp;nproc=%d\n",rank,nprocs);<br></blockquote><blockquote type="cite"> &nbsp;if (rank==0){<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;profit1=simulateRuns(n/nprocs,m,s,S);<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;stat(profit1,n/2);<br></blockquote><blockquote type="cite"> &nbsp;MPI_Send(profit1,n/nprocs,MPI_DOUBLE,1,tag,MPI_COMM_WORLD);<br></blockquote><blockquote type="cite"> &nbsp;}<br></blockquote><blockquote type="cite"> &nbsp;if(rank==1){<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;profit2=simulateRuns(n/nprocs,m,s,S);<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;stat(profit2,n/2);<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;MPI_Irecv(profit,n/nprocs,MPI_DOUBLE,0,tag,MPI_COMM_WORLD,&amp;status);<br></blockquote><blockquote type="cite"> &nbsp;}<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;MPI_Finalize ();<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;after=GetTickCount();<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;printf("time elapsed=%ld\n",(after-before));<br></blockquote><blockquote type="cite">}<br></blockquote><blockquote type="cite">/* OUTPUT*/<br></blockquote><blockquote type="cite">C:\Users\Sankar\My Documents\visual studio 2008\Projects\Inventorympi\Debug&gt;mpie<br></blockquote><blockquote type="cite">xec -n 2 Inventorympi.exe<br></blockquote><blockquote type="cite">Fatal error in MPI_Finalize: Other MPI error, error stack:<br></blockquote><blockquote type="cite">MPI_Finalize(318).........................: MPI_Finalize failed<br></blockquote><blockquote type="cite">MPI_Finalize(211).........................:<br></blockquote><blockquote type="cite">MPID_Finalize(92).........................:<br></blockquote><blockquote type="cite">PMPI_Barrier(476).........................: MPI_Barrier(comm=0x44000002) failed<br></blockquote><blockquote type="cite">MPIR_Barrier(82)..........................:<br></blockquote><blockquote type="cite">MPIC_Sendrecv(164)........................:<br></blockquote><blockquote type="cite">MPIC_Wait(513)............................:<br></blockquote><blockquote type="cite">MPIDI_CH3i_Progress_wait(215).............: an error occurred while handling an<br></blockquote><blockquote type="cite">event returned by MPIDU_Sock_Wait()<br></blockquote><blockquote type="cite">MPIDI_CH3I_Progress_handle_sock_event(420):<br></blockquote><blockquote type="cite">MPIDU_Sock_wait(2606).....................: The specified network name is no lon<br></blockquote><blockquote type="cite">ger available. (errno 64)<br></blockquote><blockquote type="cite">Fatal error in MPI_Recv: Other MPI error, error stack:<br></blockquote><blockquote type="cite">MPI_Recv(187).............................: MPI_Recv(buf=CCCCCCCC, count=250, MP<br></blockquote><blockquote type="cite">I_DOUBLE, src=0, tag=1, MPI_COMM_WORLD, status=0023F920) failed<br></blockquote><blockquote type="cite">MPIDI_CH3i_Progress_wait(215).............: an error occurred while handling an<br></blockquote><blockquote type="cite">event returned by MPIDU_Sock_Wait()<br></blockquote><blockquote type="cite">MPIDI_CH3I_Progress_handle_sock_event(455):<br></blockquote><blockquote type="cite">adjust_iov(825)...........................: ch3|sock|immedread 00566358 008B0FE8<br></blockquote><blockquote type="cite"> 00FC0048<br></blockquote><blockquote type="cite">MPIDU_Sock_readv(2750)....................: An established connection was aborte<br></blockquote><blockquote type="cite">d by the software in your host machine. (errno 10053)<br></blockquote><blockquote type="cite">Thank you<br></blockquote><blockquote type="cite">------------------------------------------------------------------------<br></blockquote><blockquote type="cite">_______________________________________________<br></blockquote><blockquote type="cite">mpich-discuss mailing list<br></blockquote><blockquote type="cite"><a href="mailto:mpich-discuss@mcs.anl.gov">mpich-discuss@mcs.anl.gov</a><br></blockquote><blockquote type="cite"><a href="https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss">https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss</a><br></blockquote><br>-- <br>Pavan Balaji<br><a href="http://www.mcs.anl.gov/~balaji">http://www.mcs.anl.gov/~balaji</a><br>_______________________________________________<br>mpich-discuss mailing list<br>mpich-discuss@mcs.anl.gov<br>https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss<br></div></blockquote></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><span class="Apple-style-span" style="font-size: 12px; "><div><font class="Apple-style-span" color="#000000">--------------------------------------------------</font></div><div><font class="Apple-style-span" color="#000000">Francisco Javier García Blas</font></div><div><font class="Apple-style-span" color="#000000">Computer Architecture, Communications and Systems Area.</font></div><div><font class="Apple-style-span" color="#000000">Computer Science Department. UNIVERSIDAD CARLOS III DE MADRID</font></div><div><font class="Apple-style-span" color="#000000">Avda. de la Universidad, 30</font></div><div><font class="Apple-style-span" color="#000000">28911 Leganés (Madrid), SPAIN</font></div><div><font class="Apple-style-span" color="#000000">e-mail:&nbsp;<a href="mailto:fjblas@arcos.inf.uc3m.es">fjblas@arcos.inf.uc3m.es</a></font></div><div><font class="Apple-style-span" color="#000000">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<a href="mailto:fjblas@inf.uc3m.es">fjblas@inf.uc3m.es</a></font></div><div><font class="Apple-style-span" color="#000000">Phone:(+34) 916249118</font></div><div><font class="Apple-style-span" color="#000000">FAX: (+34) 916249129</font></div><div><font class="Apple-style-span" color="#000000">--------------------------------------------------</font></div></span></div></div></span></span>
</div>
<br></body></html>