Hello,
<div><br></div>
<div>I installed MPICH2 to two computers ( 'suaddell' and 'o01' ) with Windows 7 operating system. Everything is good. I can run simple "Hello World" applications in both hosts. But when I try to run simple MPI_Send and MPI_Recv applications, the program does not end, it hangs. I can see it runs without end on my computer and remote host by using Resource Monitor. If I press "Ctrl+C", it is ended and it displays below message, it pretends that every things work fine.</div>
<div><br></div>
<div>----------------------------------------------------------------------</div>
<div>mpiexec command and the message after Ctrl+C</div>
<div>----------------------------------------------------------------------</div>
<div><br></div>
<div>C:\>mpiexec.exe -hosts 2 suaddell o01 -noprompt mesajlasma.exe</div>
<div>
<div>mpiexec aborting job...</div>
<div>Received Message :Hello World</div>
<div>_OK!_</div>
<div><br></div>
<div>job aborted:</div>
<div>rank: node: exit code[: error message]</div>
<div>0: suaddell: 123: mpiexec aborting job</div>
<div>1: o01: 123</div></div>
<div><br></div>
<div><br></div>
<div>------------------------</div>
<div>the code is here:</div>
<div>------------------------</div>
<div><br></div>
<div>
<div>#include "stdafx.h"</div>
<div>#include "string.h"</div>
<div>#include "mpi.h"</div>
<div><br></div>
<div>int main(int argc, char* argv[])</div>
<div>{</div>
<div><br></div>
<div><span style="WHITE-SPACE: pre-wrap"></span>int nTasks, rank;</div>
<div><span style="WHITE-SPACE: pre-wrap"></span>char mesaj[20];</div>
<div><span style="WHITE-SPACE: pre-wrap"></span>MPI_Status status;</div>
<div><br></div>
<div><span style="WHITE-SPACE: pre-wrap"></span>MPI_Init(&argc,&argv);</div>
<div><span style="WHITE-SPACE: pre-wrap"></span>MPI_Comm_size(MPI_COMM_WORLD,&nTasks);</div>
<div><span style="WHITE-SPACE: pre-wrap"></span>MPI_Comm_rank(MPI_COMM_WORLD,&rank);</div>
<div><br></div>
<div><span style="WHITE-SPACE: pre-wrap"></span>if(rank == 1)</div>
<div><span style="WHITE-SPACE: pre-wrap"></span>{</div>
<div><span style="WHITE-SPACE: pre-wrap"></span>strcpy_s(mesaj, "Hello World");</div>
<div><span style="WHITE-SPACE: pre-wrap"></span>if (MPI_SUCCESS==MPI_Send(mesaj, strlen(mesaj)+1, MPI_CHAR, 0, 7, MPI_COMM_WORLD)) printf("_OK!_\n");</div>
<div><span style="WHITE-SPACE: pre-wrap"></span>}</div>
<div><br></div>
<div><br></div>
<div><span style="WHITE-SPACE: pre-wrap"></span>if(rank == 0)</div>
<div><span style="WHITE-SPACE: pre-wrap"></span>{</div>
<div><span style="WHITE-SPACE: pre-wrap"></span>MPI_Recv(mesaj, 20, MPI_CHAR, 1, 7, MPI_COMM_WORLD, &status);</div>
<div><span style="WHITE-SPACE: pre-wrap"></span>printf("Received Message :%s\n", mesaj);</div>
<div><span style="WHITE-SPACE: pre-wrap"></span>}</div>
<div><br></div>
<div><span style="WHITE-SPACE: pre-wrap"></span>MPI_Finalize();</div>
<div><br></div>
<div><span style="WHITE-SPACE: pre-wrap"></span>return 0;</div>
<div>}</div></div>
<div><br></div>
<div><br></div>
<div>--------------------------------------------------------------------------------------------------------------------------------------------------------</div>
<div>When the program runs by using "-verbose" , i can see that the system is waiting here untill pressing "Ctrl+C":</div>
<div>--------------------------------------------------------------------------------------------------------------------------------------------------------</div>
<div>.</div>
<div>(There are a lot of lines here)</div>
<div>.</div>
<div>......command written to left: "cmd=result src=0 dest=2 tag=5 cmd_tag=0 ctx_key=<br>0 result=SUCCESS "<br>......\smpd_free_command<br>.......\smpd_init_command<br>......./smpd_init_command<br>....../smpd_free_command<br>
...../smpd_state_writing_cmd<br>..../smpd_handle_op_write<br>....sock_waiting for the next event.<br>....\SMPDU_Sock_wait<br></div>
<div>(this is the last line till I press "Ctrl+C")</div>
<div> </div>
<div> </div>
<div>How can I fix this problem.</div>
<div> </div>
<div>Thanks in advance</div>
<div> </div>
<div>Suad Basbug</div>
<div>Nevsehir University</div>
<div>Turkey<br></div>