1

I installed MPICH2 to two computers ( 'suaddell' and 'o01' ) with Windows 7 operating system. I use VC++ Express Edition 2008 for compiling. Everything is good. I can run simple "Hello World" MPI 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.


mpiexec command and the message after Ctrl+C

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

the code is here:

#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;
}

When the program runs by using "-verbose" , i can see that the system is waiting here untill pressing "Ctrl+C":

. (There are a lot of lines here) .

......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

(this is the last line till I press "Ctrl+C")

How can I fix this problem.

Thanks in advance

2
  • Are you sure for the command? In Linux, the command is mpirun. Commented Sep 6, 2011 at 12:43
  • @Dimitri: mpiexec and mpirun are the same, in OpenMPI both are pointing to the same file orterun. Commented Sep 30, 2011 at 15:52

1 Answer 1

2

Upgrade to the latest version of MPICH2, version 1.4.1p1.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.