Why are all my open MPI processes rank 0?

I am writing a parallel program using Open MPI. I am running Snow Leopard 10.6.4 and I installed Open MPI through the homebrew package manager.

When I run my program using mpirun -np 8 ./test , each process reports that it has a rank of 0, and assumes that the total number of processes equal to 1, and 8 lines of the process rank: 0, total processes: 1 , will be issued to the console.

I know this is not a problem with the code, since the same code will compile and run as expected on some Ubuntu machines in my college computer lab. I checked the homebrew error debugger and no one reported a problem with the Open MPI package. I'm at a loss.

+6
homebrew openmpi macos
source share
4 answers

Check which mpirun you are calling. The running mpirun runs 8 independent instances of the binary. Thus, each instance is an MPI application with a universe size of 1 and a rank of 0.

In addition, if you do not plan to run the final code in an OS X cluster, I highly recommend installing the Linux version in a virtual machine (for example, a virtual block) for testing and developing these codes.

+4
source share

Delete the previous MPI implementation.

In my case, I installed MPICH2 first, then uninstalled it and switched to OpenMPI. Then the same case occurred, the whole rank of the process was 0. What I did to fix this problem: completely remove MPICH2 from my system (I use Ubuntu / Debian Linux).

 # apt-get remove mpich2 # apt-get autoremove 
+4
source share

I had the same problem with openMPI in C on linux. Using MPIch2 instead, the problem has been fixed (but don't forget to run MPI_Finalize () at the end or it gets weird.)

+1
source share

Today I met the same problem as you. And finally, I got a solution.

See https://wiki.mpich.org/mpich/index.php/Frequently_Asked_Questions#Q:_All_my_processes_get_rank_0

Simply put, the answer says that MPI needs a suitable PMI to talk about its ranks and about something else. Therefore, to run the MPI program, we need to use the appropriate mpirun / mpiexec.

I assume that your problem is due to a mismatch between the mpi software compiler and the mpirun tool. Therefore, try to delete everything and install MPICH / openMPI (be sure to install one of them).

+1
source share

All Articles