Python 大型ish阵列的MPI.Gather调用挂起

Python 大型ish阵列的MPI.Gather调用挂起,python,openmpi,mpi4py,Python,Openmpi,Mpi4py,我使用mpi4py来并行化我的Python应用程序。我注意到每当我将进程数量或涉及的数组大小增加太多时,我就会在MPI.Gather期间遇到死锁 例子: 执行此命令将提供: $ mpirun -n 4 python bug.py 1 gathering 2 gathering 3 gathering 0 gathering 1 done 2 done 而进程0和3无限期挂起。但是,如果我将数组维度更改为(10400,15),或者使用-n2运行脚本,则一切都会正常工作 我错过什么了吗?这是Op

我使用mpi4py来并行化我的Python应用程序。我注意到每当我将进程数量或涉及的数组大小增加太多时,我就会在MPI.Gather期间遇到死锁

例子: 执行此命令将提供:

$ mpirun -n 4 python bug.py 
1 gathering
2 gathering
3 gathering
0 gathering
1 done
2 done
而进程0和3无限期挂起。但是,如果我将数组维度更改为
(10400,15)
,或者使用
-n2
运行脚本,则一切都会正常工作

我错过什么了吗?这是OpenMPI或mpi4py中的错误吗

站台:
  • 奥斯莫哈韦
  • OpenMPI 4.0.0(通过自制)
  • mpi4py 3.0.1
  • Python 3.7

我刚刚注意到,通过自制的MPICH,一切都很好。因此,如果有人在OSX上遇到类似的情况,就需要一个解决方法

$ brew unlink open-mpi
$ brew install mpich
$ pip uninstall mpi4py
$ pip install mpi4py --no-cache-dir
然后,我不得不编辑
/etc/hosts
并添加行

127.0.0.1     <mycomputername>
127.0.0.1
以使MPICH正常工作

更新


现在,这个问题应该已经解决了。并将OpenMPI更新为4.0.1为我修复了它。

谢谢!我也遇到了同样的问题,这个解决方案成功了!
127.0.0.1     <mycomputername>