无法将所有内核与mpirun一起使用 [英] Unable to use all cores with mpirun

查看:252
本文介绍了无法将所有内核与mpirun一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在台式机上测试一个简单的MPI程序(Ubuntu LTS 16.04/Intel®Core™i3-6100U CPU @ 2.30GHz×4/gcc 4.8.5/OpenMPI 3.0.0),而mpirun不会让我使用机器上的所有内核(4).当我跑步时:

I'm testing a simple MPI program on my desktop (Ubuntu LTS 16.04/ Intel® Core™ i3-6100U CPU @ 2.30GHz × 4/ gcc 4.8.5 /OpenMPI 3.0.0) and mpirun won't let me use all of the cores on my machine (4). When I run:

$ mpirun -n 4 ./test2

我收到以下错误:

--------------------------------------------------------------------------
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.
--------------------------------------------------------------------------

但是如果我使用:

$ mpirun -n 2 ./test2

一切正常.

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

I've seen from other answers that I can check the number of processors with

cat /proc/cpuinfo | grep processor | wc -l

这告诉我我有4个处理器.我对不感兴趣,我只想能够使用我所有的处理器.有人可以帮忙吗?

and this tells me that I have 4 processors. I'm not interested in oversubscribing, I'd just like to be able to use all my processors. Can anyone help?

推荐答案

您的处理器具有4个超线程,但只有2个内核(请参阅规格

Your processor has 4 hyperthreads but only 2 cores (see the specs here).

默认情况下,每个内核的Open MPI最多运行一个MPI任务. 使用以下选项,您可以使每个超级线程的Open MPI最多运行一个MPI任务

By default, Open MPI does not run more than one MPI task per core. You can have Open MPI run up to one MPI task per hyperthread with the following option

mpirun --use-hwthread-cpus ...

FWIW

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

The command you mentioned reports the number of hyperthreads.

找出计算机拓扑的更好方法是通过hwloc软件包中的lstopo命令.

A better way to figure out the topology of a machine is via the lstopo command from the hwloc package.

MPI任务没有绑定在OS X的内核或线程上,因此,如果您在Mac上运行,则--oversubscribe -np 4会导致相同的结果.

MPI tasks are not bound on cores nor threads on OS X, so if you are running on a Mac, the --oversubscribe -np 4 would lead to the same result.

这篇关于无法将所有内核与mpirun一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆