install
$ brew install open-mpi $ brew reinstall gcc --without-multilib $ sudo pip install mpi4py
test
$ mpirun -np 2 echo 'hello~' $ mpiexec -n 5 python -m mpi4py helloworld
异常
[zhipeng-MacBook:65764] [[47911,0],0] ORTE_ERROR_LOG: Bad parameterin file orted/pmix/pmix_server.c at line 262
[zhipeng-MacBook:65764] [[47911,0],0] ORTE_ERROR_LOG: Bad parameterin file ess_hnp_module.c at line 666
It looks likeorte_init failed for some reason; your parallel process is
likely to abort. There are many reasons that a parallel processcan
fail during orte_init; some of which are due to configurationor
environment problems. This failure appears to be an internalfailure;
here’s some additional information (which may only be relevant toan
Open MPI developer):
pmix server initfailed
→Returned value Bad parameter (-5) instead ofORTE_SUCCESS
解决办法
$ export TMPDIR=/tmp