python - Microsoft MPI 中的 -bind-to 命令

标签 python mpi openmpi ms-mpi

在安装了 Open MPI 的 Ubuntu 上,我可以使用 -bind-to 命令将每个进程绑定(bind)到物理核心,例如 mpiexec -np 4 -bind-to core python mycode.py。现在我必须在安装了MS-MPI的Windows上工作,我不知道是否有类似的功能。

我尝试根据 this page 使用 -affinity 和 -affinity_layout喜欢

mpiexec -np 4 -affinity -affinity_layout spread:P python mycode.py

这应该会在我的 2 个物理核心笔记本电脑上引发错误。但效果很好。你有什么想法吗?

最佳答案

与 Microsoft MPI 的亲和性确实有效;当多个排名落在单个核心上时(即当您超额订阅时),Microsoft MPI 不会提示。

可以在“任务管理器>详细信息>(右键单击进程)>设置关联性”中找到正在运行的进程的关联性。

所以,在我的 10 核机器上,运行

mpiexec -n 2 -affinity -affinity_layout spread:P notepad.exe

产生亲和性

rank | 0 | 1 |
CPU  | 0 | 5 |

运行时

mpiexec -n 11 -affinity -affinity_layout spread:P notepad.exe

结果

rank | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
CPU  | 0 | 5 | 1 | 6 | 2 | 7 | 3 | 8 | 4 | 9 | 0  |

即,当所有核心都耗尽时,映射会默默地回绕。

关于python - Microsoft MPI 中的 -bind-to 命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53578513/

相关文章:

Python-计算单词列表中的每个字母

bash - 如何同时使用 nohup 和 time ?

c++ - 发送具有 std::vector 成员的结构时出现段错误

openmpi 2.1.2错误: UCX ERROR UCP version is incompatible

python - 在 scikit dict vectorizer 中按特征名称提取特征

python - 如何在类中装饰方法?

MPI:如何区分MPI_Wait中的send和recv

c - MPI vector 乘法

c - C 中未映射的 MPI 地址

python - 如何在python中用颜色代码绘制矩阵稀疏模式?