mpi - 打开 MPI 4.0 内核和内存绑定(bind)

标签 mpi numa

我需要一些关于如何使用 Open MPI 4.0.1 实现我想要的核心和内存绑定(bind)的提示。 这是针对具有 8 个 NUMA 节点和 64 个内核的单个计算节点,即 2x AMD Epyc 7551,禁用 SMT。

该系统上的内核根据以下方案编号:

enter image description here

现在我想到了 3 种不同的绑定(bind)策略,我们称它们为“close”、“spread”和“scatter”。我将为每个具有 6,16 和 48 个线程的示例提供 3 个示例,以阐明我的想法(希望如此)。但我需要适用于 1 到 64 之间任意数量的 MPI 线程的方法。

1: "close" 这里的想法是让线程尽可能靠近,即最小化核心-核心延迟。 enter image description here enter image description here enter image description here

2:“传播”以利用所有可用内存带宽的想法

enter image description here enter image description here enter image description here

3: "scatter" 这背后的想法是,每个 NUMA 节点再次分成 2 组,每组 4 个核心,每个组都有自己的 L3 缓存。与“传播”相比,该策略应该最大化每个线程可用的 L3 缓存量。

enter image description here enter image description here enter image description here

为了实现这 3 个策略中的每一个,我需要将哪些参数传递给 mpirun?或任何其他方法,如果这不能在没有帮助的情况下实现,例如机器文件。

最佳答案

我没有硬件来测试它,所以我不能保证这是正确的答案

  • “关闭” mpirun --bind-to core --rank-by core --map-by core ...
  • “传播” mpirun --bind-to core --rank-by core --map-by numa ...
  • “分散” mpirun --bind-to core --rank-by core --map-by l3cache ...

您还可以mpirun --report-bindings ... 以查看 MPI 任务是如何被 Open MPI 固定的。

关于mpi - 打开 MPI 4.0 内核和内存绑定(bind),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58133746/

相关文章:

c - numactl -- 硬件显示不正确的信息

c - 如何使用 MPI 正确编码?

mpi - 为什么 MPI_Init 接受指向 argc 和 argv 的指针?

c++ - MPI派生的数据类型问题是由结构填充和无阻塞通信缓冲区的问题引起的

c++ - 如何使用 MPI 和 C++ 从文本文件中读取整数

c++ - MPI all to all operation 一次只处理一个巨大矩阵的一部分

c - Linux操作系统如何在有多个套接字时调度线程

linux - 在 linux(CentOS)/多处理器设置中,如何将 CPU 内核分配给 NUMA 节点?