Unable to use all cores with mpirun

后端 未结 2 1232
深忆病人
深忆病人 2021-02-09 06:39

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 cor

相关标签:
2条回答
  • 2021-02-09 07:33

    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.

    0 讨论(0)
  • 2021-02-09 07:42

    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)

    0 讨论(0)
提交回复
热议问题