OpenFOAM使用mpirun的时候报错
-
电脑cpu核数是 112核,但是我使用64并行运算的时候就报了这个错误,希望有人帮忙解答一下怎么修改
There are not enough slots available in the system to satisfy the 64 slots that were requested by the application: overInterDyMFOAM 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
-
首先你需要确定下你的机器具体有多少CPU核心,我猜测你CPU实际上是56核112线程——这种制式偶尔也草率地称为112核,或者称为56颗物理核心/112颗逻辑核心。
mpirun的默认
slot
数是你的物理核心数量而不是逻辑核心数。考虑到我们的物理核心可能只有56颗,在64并行运算时程序报告not enough slots available
是非常合理的。在这种情况下,你问题的答案就在错误报告的最后面写着:
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
简单翻译一下:
情况4:如果没指定远程计算资源,OpenMPI使用本机的
处理器核心数
作为slots
的默认值;.....,如果你想要让Open MPI使用
硬件线程数(112)
代替处理器核心数(56)
(作为默认Slot数量),使用--use-hwthread-cpus
选项。或者,如果你想要在决定的启动的进程数这个问题上忽略可用
slot
数量,使用--oversubsribe
选项。
这样来看,如果你的CPU确实是56核112线程的话,加一个
--use-hwthread-cpus
参数是更合适的选项。不过使用超线程会使得加速比下降,也许56并行和64并行也没差多少。