【问题标题】:Change the number of cores OpenMPI can "see"更改 OpenMPI 可以“看到”的核心数量
【发布时间】:2019-10-19 08:06:57
【问题描述】:

我正在运行调用mpirun 的可执行文件(我无权访问源代码)。如果请求的内核数多于 CPU 上的可用内核数,我会收到以下错误:

There are not enough slots available in the system to satisfy the 12
slots that were requested by the application:

  /Users/me/Library/app/executable

Either request fewer slots for your application, or make more slots
available for use.

A "slot" is the Open MPI term for an allocatable unit where we can
launch a process.  The number of slots available are defined by the
environment in which Open MPI processes are run:

  1. Hostfile, via "slots=N" clauses (N defaults to number of
     processor cores if not provided)
  2. The --host command line parameter, via a ":N" suffix on the
     hostname (N defaults to 1 if not provided)
  3. Resource manager (e.g., SLURM, PBS/Torque, LSF, etc.)
  4. If none of a hostfile, the --host command line parameter, or an
     RM is present, Open MPI defaults to the number of processor cores

In all the above cases, if you want Open MPI to default to the number
of hardware threads instead of the number of processor cores, use the
--use-hwthread-cpus option.

Alternatively, you can use the --oversubscribe option to ignore the
number of available slots when deciding the number of processes to
launch.

我的问题是我无法更改 mpirun 的命令行选项,例如使用--oversubscribe。相反,我需要更改 OpenMPI “看到”的默认内核数。 (这将是一个简单的修复,否则就像this case

是否有环境变量或我可以更新的东西来欺骗 openMPI 工作?

【问题讨论】:

    标签: mpi openmpi precompiled


    【解决方案1】:

    啊。我在/usr/local/etc/openmpi-default-hostfile(在 Mac 上)找到了默认的 OpenMPI 主机文件,并在末尾添加(在新行中):

    localhost slots=12

    所以 OpenMPI 正在读取默认的 slots 计数 6,因为我的系统上有 6 个内核(该错误仅发生在 >6 个请求的 CPU 上)。但是我有 12 个线程并且想满负荷使用 CPU。

    这对我有用,因为我没有在命令行中运行 mpirun

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-07-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-11-06
      相关资源
      最近更新 更多