Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why Do All My Open MPI Processes Have Rank 0?

I'm writing a parallel program using Open MPI. I'm 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, every process reports that it has rank 0, and believes the total number of processes to be 1, and 8 lines of process rank: 0, total processes: 1 get spit out to the console.

I know it's not a code issue, since the exact same code will compile and run as expected on some Ubuntu machines in my college's computer lab. I've checked homebrew's bug tracker, and no-one's reported an issue with the Open MPI package. I'm at a loss.

like image 832
aperiodic Avatar asked Oct 28 '10 03:10

aperiodic


3 Answers

Today I met the same problem like you. And finally I got the solution.

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

Simply speaking, the answer says, MPI needs suitable PMI to tell processes about their ranks and something else. Therefore, we need to use corresponding mpirun/mpiexec to run the MPI program.

I guess that your problem is related to the mismatch between mpi program compiler and the mpirun tool. So try to uninstall all, and install MPICH/openMPI(make sure just install one of them).

like image 155
罗泽轩 Avatar answered Nov 07 '22 17:11

罗泽轩


Check which mpirun you are invoking. The mpirun that is being executed is launching 8 independent instances of the binary. So each instance is an MPI application with a universe size of 1 and rank 0.

Also, unless you are planning to run the final code on a cluster of OS X boxes, I highly recommend installing a Linux version in a VM, like virtualbox, to test & develop these codes.

like image 32
powerrox Avatar answered Nov 07 '22 16:11

powerrox


Uninstall previous MPI implementation completely.

In my case I installed MPICH2 first, then uninstalled it, and changed to OpenMPI. Then same case occured, all process' rank were 0. What I did to fix this problem is: uninstall MPICH2 completely from my system (I use Ubuntu/Debian Linux).

# apt-get remove mpich2
# apt-get autoremove
like image 6
Auriza Akbar Avatar answered Nov 07 '22 15:11

Auriza Akbar