Parallel processing MPI_发送和MPI_接收

Parallel processing MPI_发送和MPI_接收,parallel-processing,mpi,mpich,Parallel Processing,Mpi,Mpich,我在两台装有Windows7操作系统的计算机(“suaddell”和“o01”)上安装了MPICH2。我使用VC++Express Edition 2008进行编译。一切都很好。我可以在两台主机上运行简单的“Hello World”MPI应用程序。但当我尝试运行简单的MPI_发送和MPI_接收应用程序时,程序并没有结束,而是挂起。通过使用资源监视器,我可以看到它在我的计算机和远程主机上无休止地运行。若我按下“Ctrl+C”,它就结束了,并显示下面的消息,它假装一切正常 mpiexec命令和Ct

我在两台装有Windows7操作系统的计算机(“suaddell”和“o01”)上安装了MPICH2。我使用VC++Express Edition 2008进行编译。一切都很好。我可以在两台主机上运行简单的“Hello World”MPI应用程序。但当我尝试运行简单的MPI_发送和MPI_接收应用程序时,程序并没有结束,而是挂起。通过使用资源监视器,我可以看到它在我的计算机和远程主机上无休止地运行。若我按下“Ctrl+C”,它就结束了,并显示下面的消息,它假装一切正常


mpiexec命令和Ctrl+C之后的消息
代码如下:
当程序使用“-verbose”运行时,我可以看到系统在这里等待,直到按下“Ctrl+C”: 。 (这里有很多行)

(这是我按下“Ctrl+C”之前的最后一行)

我怎样才能解决这个问题


提前感谢

升级到最新版本的MPICH2,版本1.4.1p1。

您确定该命令正确吗?在Linux中,命令是mpirun。@Dimitri:mpiexec和mpirun是相同的,在OpenMPI中,两者都指向同一个文件或运行。
C:\>mpiexec.exe -hosts 2 suaddell o01 -noprompt mesajlasma.exe
mpiexec aborting job...
Received Message :Hello World
_OK!_

job aborted:
rank: node: exit code[: error message]
0: suaddell: 123: mpiexec aborting job
1: o01: 123
#include "stdafx.h"
#include "string.h"
#include "mpi.h"

int main(int argc, char* argv[])
{

int  nTasks, rank;
char mesaj[20];
MPI_Status status;

MPI_Init(&argc,&argv);
MPI_Comm_size(MPI_COMM_WORLD,&nTasks);
MPI_Comm_rank(MPI_COMM_WORLD,&rank);

if(rank == 1)
{
strcpy_s(mesaj, "Hello World");
if (MPI_SUCCESS==MPI_Send(mesaj, strlen(mesaj)+1, MPI_CHAR, 0, 7, MPI_COMM_WORLD)) printf("_OK!_\n");
}

if(rank == 0)
{
MPI_Recv(mesaj, 20, MPI_CHAR, 1, 7, MPI_COMM_WORLD, &status);
printf("Received Message :%s\n", mesaj);
}

MPI_Finalize();

return 0;
}
......command written to left: "cmd=result src=0 dest=2 tag=5 cmd_tag=0 ctx_key=
0 result=SUCCESS "
......\smpd_free_command
.......\smpd_init_command
......./smpd_init_command
....../smpd_free_command
...../smpd_state_writing_cmd
..../smpd_handle_op_write
....sock_waiting for the next event.
....\SMPDU_Sock_wait