error with mpi_comm_rank and mpi_comm_size
I downloaded the code today and tried the example in demo/wrap-f2py, and I get wrong result.
-
I build mpi4py from source with mpich3 (wrapping ifort).
-
I compiled helloworld.f90 code with -fcompiler=intelem, which successfully generated helloworld.so.
-
However, when I do make test, there is what I got:
mpiexec -n 5 python test.py
You passed MPI_COMM_NULL !!!
Hello, World! I am process 5 of 0 on Dell.
You passed MPI_COMM_NULL !!!
Hello, World! I am process 5 of 0 on Dell.
You passed MPI_COMM_NULL !!!
Hello, World! I am process 5 of 0 on Dell.
You passed MPI_COMM_NULL !!!
Hello, World! I am process 5 of 0 on Dell.
You passed MPI_COMM_NULL !!!
Hello, World! I am process 5 of 0 on Dell.
-------------------------------------------more information-----------------------------------
- I also tried the example in demo/wrap-c, I got the similar answer.
/home/junteng/lib/mpich-3.2-install/bin/mpiexec -n 5 python test.py
You passed MPI_COMM_NULL !!!
Hello, World! I am process 5 of 0 on Dell.
You passed MPI_COMM_NULL !!!
Hello, World! I am process 5 of 0 on Dell.
You passed MPI_COMM_NULL !!!
Hello, World! I am process 5 of 0 on Dell.
You passed MPI_COMM_NULL !!!
Hello, World! I am process 5 of 0 on Dell.
You passed MPI_COMM_NULL !!!
Hello, World! I am process 5 of 0 on Dell.
However, if I use the environment and mpi4py package installed from anaconda, then the demo/wrap-c example runs successfully.
Would you help me with this ?
Thanks a million !!!
(my only change is the makefile, -fcompiler=intelem)
Comments (10)
-
reporter -
Well, if you changeed compiler, that may explain it. I guess the Intel compiler picks an MPI implementation (i.e Intel MPI) that is different from the one you used to build mpi4py.
-
reporter I don't think so
By using the distribution out on 2015-10 the code works correctly
I know for sure I am using mpich instead of Intel mpi
-
Please run
ldd
on the*.so
f2py module to double check. -
Oh! Maybe you need to change
MPIF90 = mpiifort
in the makefile? -
- marked as trivial
- edited description
-
reporter The mpich command is mpif90 ...
-
Yes, sorry, you are right.
-
@000Justin000 Any update?
-
- changed status to closed
- Log in to comment
The error is "I am process 5 of 0 on Dell", well it should be "I am process x of 5 on Dell"