无法使用mpirun的所有核心

Jam*_*ith 4 hpc mpi openmpi

我正在我的桌面上测试一个简单的MPI程序(Ubuntu LTS 16.04 /Intel®Core™i3-6100U CPU @ 2.30GHz×4/gcc 4.8.5/OpenMPI 3.0.0)并且mpirun不会让我使用全部我机器上的核心(4).当我跑:

$ mpirun -n 4 ./test2
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

--------------------------------------------------------------------------
There are not enough slots available in the system to satisfy the 4 slots
that were requested by the application:
  ./test2

Either request fewer slots for your application, or make more slots available
for use.
--------------------------------------------------------------------------
Run Code Online (Sandbox Code Playgroud)

但如果我跑:

$ mpirun -n 2 ./test2
Run Code Online (Sandbox Code Playgroud)

一切正常.

我从其他答案中看到我可以检查处理器的数量

cat /proc/cpuinfo | grep processor | wc -l
Run Code Online (Sandbox Code Playgroud)

这告诉我,我有4个处理器.我对超额订阅感兴趣,我只是希望能够使用我所有的处理器.有人可以帮忙吗?

Gil*_*det 12

您的处理器有4个超线程但只有2个内核(请参阅https://ark.intel.com/products/88180/Intel-Core-i3-6100U-Processor-3M-Cache-2_30-GHz上的规格).

默认情况下,Open MPI不会为每个核心运行多个MPI任务.使用以下选项,您可以让Open MPI为每个超线程运行最多一个MPI任务

mpirun --use-hwthread-cpus ...
Run Code Online (Sandbox Code Playgroud)

FWIW

您提到的命令报告了超线程的数量.

找出机器拓扑结构的更好方法是通过包中的lstopo命令hwloc.

MPI任务不受OS X上的内核和线程的约束,因此如果您在Mac上运行,--oversubscribe -np 4则会导致相同的结果.