Unable to use all cores with mpirun

北战南征 提交于 2019-12-04 09:07:19
Gilles Gouaillardet

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

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.

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

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.

Use $ lscpu the number of cores per socket * number of sockets would give you number of physical cores(the ones that you can use for mpi) where as sockets per core * number of sockets * threads per core will give you number of logical cores(the one that you get by using the command $ cat /proc/cpuinfo | grep processor | wc -l)

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!