[OMPI users] MPI_INIT gets stuck

2016-03-06 Thread Marco Lubosch

Hello guys,

I try to do the first steps with Open MPI and I finally got it work on 
Cygwin64(Windows 7 64bit).
I am able to compile plain C code without any issues via "mpicc ..." but 
when I try to initialize MPI the program is getting stuck within 
"MPI_INIT" without creating CPU load. Example from 
https://svn.open-mpi.org/source/xref/ompi_1.8/examples/:


   #include 
   #include "mpi.h"
   int main(int argc, char* argv[])
   {
int rank, size, len;
char version[MPI_MAX_LIBRARY_VERSION_STRING];
printf("1\n");
MPI_Init(&argc, &argv);
printf("2\n");
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
printf("3\n");
MPI_Comm_size(MPI_COMM_WORLD, &size);
printf("4\n");
MPI_Get_library_version(version, &len);
printf("5\n");
printf("Hello, world, I am %d of %d, (%s, %d)\n", rank, size,
   version, len);
MPI_Finalize();
printf("6\n");
return 0;
   }

Compiling works perfectly fine with "mpicc -o hello_c.exe hello_c.c". 
But when I run it with "mpirun -np 4 ./hello_c" it creates 4 threads 
printing "1" but then keeps on running without doing anything. I then 
have to kill the threads manually to keep on working with Cygwin.


Can you tell me what I am doing wrong?

Thanks
Marco

PS: Installed packages on Cygwin are libopenmpi, libopenmpi-devel, 
openmpi, gcc-core


Re: [OMPI users] MPI_INIT gets stuck

2016-03-07 Thread Marco Lubosch

Thanks Marco,

I reinstalled Cygwin and OMPI like 10 times. I had an issues with 
gcc(mingw) because it was preinstalled under windows. I then had to 
remove it and reinstall gcc under cygwin and got it working but as I 
said only copiling plain C code with "mpicc". I also disabled Windows 
Firewall and tried a different router.


Do you have any suggestions what could cause that problem?

Greetings
Marco

Am 07.03.2016 um 15:26 schrieb Marco Atzeri:



On 06/03/2016 10:06, Marco Lubosch wrote:

Hello guys,

I try to do the first steps with Open MPI and I finally got it work on
Cygwin64(Windows 7 64bit).
I am able to compile plain C code without any issues via "mpicc ..." but
when I try to initialize MPI the program is getting stuck within
"MPI_INIT" without creating CPU load. Example from
https://svn.open-mpi.org/source/xref/ompi_1.8/examples/:

#include 
#include "mpi.h"
int main(int argc, char* argv[])
{
 int rank, size, len;
 char version[MPI_MAX_LIBRARY_VERSION_STRING];
 printf("1\n");
 MPI_Init(&argc, &argv);
 printf("2\n");
 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
 printf("3\n");
 MPI_Comm_size(MPI_COMM_WORLD, &size);
 printf("4\n");
 MPI_Get_library_version(version, &len);
 printf("5\n");
 printf("Hello, world, I am %d of %d, (%s, %d)\n", rank, size,
version, len);
 MPI_Finalize();
 printf("6\n");
 return 0;
}

Compiling works perfectly fine with "mpicc -o hello_c.exe hello_c.c".
But when I run it with "mpirun -np 4 ./hello_c" it creates 4 threads
printing "1" but then keeps on running without doing anything. I then
have to kill the threads manually to keep on working with Cygwin.

Can you tell me what I am doing wrong?

Thanks
Marco

PS: Installed packages on Cygwin are libopenmpi, libopenmpi-devel,
openmpi, gcc-core





It seems a local issue. On my W7 64 bit:

$ mpirun -n 4 ./prova_mpi.exe
1
1
1
1
2
3
4
5
Hello, world, I am 0 of 4, (Open MPI v1.8.8, .., Aug 05, 2015, 126)
2
3
4
5
Hello, world, I am 2 of 4, (Open MPI v1.8.8, package: ..., Aug 05, 
2015, 126)

2
3
4
5
Hello, world, I am 1 of 4, (Open MPI v1.8.8, ... , Aug 05, 2015, 126)
2
3
4
5
Hello, world, I am 3 of 4, (Open MPI v1.8.8, ... , Aug 05, 2015, 126)
6
6
6
6

___
users mailing list
us...@open-mpi.org
Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
Link to this post: 
http://www.open-mpi.org/community/lists/users/2016/03/28651.php