<DIV>
<DIV>Hi</DIV>
<DIV> There are some queer errors exist in my program.</DIV>
<DIV> I spawn some children processes:</DIV>
<DIV> MPI_Comm_spawn(command,Conf, NumOfChild ,MPI_INFO_NULL, 0 , MPI_COMM_SELF ,&children , MPI_ERRCODES_IGNORE);</DIV>
<DIV> </DIV>
<DIV>and after calculating I want to send the data back to the mater processes</DIV>
<DIV>In the children processes:</DIV>
<DIV> MPI_Send(outBuf,NumofPixPrc,MPI_FLOAT,0,5,parent);</DIV>
<DIV> </DIV>
<DIV>and in the the master processes, the corresspond code is:</DIV>
<DIV> //the collection of the data from all the other children proc. <BR> for(int i=1; i<NumOfProc; i++)<BR> {<BR> int index=0;<BR> int scale2=0;</DIV>
<DIV> int RecStart = i * end ;<BR> int RecEnd ;<BR> if(i<NumOfChild){<BR> RecEnd = (i+1) * end;<BR> scale2 = RecEnd - RecStart + 2 * ncol;<BR> }<BR> else{<BR> RecEnd = nrow*ncol;<BR> scale2 = RecEnd - RecStart + ncol;<BR> }</DIV>
<DIV> //receive the buffer<BR> if(i<NumOfProc-1){ <BR> <FONT color=#ff0000>MPI_Recv(WaterDir1,scale2,MPI_FLOAT,i-1,5,children,&status);<BR></FONT> int recIndex=ncol;<BR> for(int n=RecStart; n<=RecEnd; n++)<BR> {<BR> outBuf[n] = WaterDir1[recIndex];<BR> recIndex++;<BR> }<BR> }<BR> else{<BR> <FONT color=#ff0000>MPI_Recv(WaterDir2,scale2,MPI_FLOAT,i-1,5,children,&status); <BR></FONT> int recIndex=ncol;<BR> for(int n=RecStart; n<=RecEnd; n++)<BR> {<BR> outBuf[n] = WaterDir2[recIndex];<BR> recIndex++;<BR> }<BR> }</DIV>
<DIV> </DIV>
<DIV>when the Number Of Processes is 2, the program will be OK, But when I change the number of the processes to 3 or 4.. the program will shut down in <FONT color=#ff0000>MPI_Recv</FONT> . I check the parameter, all the parameter are correct, but the program still shut down at that place....</DIV></DIV>