【问题标题】:mpirun: Unrecognized argument mcampirun:无法识别的参数 mca
【发布时间】:2016-02-20 05:51:07
【问题描述】:

我有一个 c++ 求解器,我需要使用以下命令并行运行:

nohup mpirun -np 16 ./my_exec > log.txt &

此命令将在我的节点上可用的 16 个处理器上独立运行 my_exec。这曾经完美地工作。

上周,HPC 部门执行了操作系统升级,现在,当启动相同的命令时,我收到两条警告消息(针对每个处理器)。第一个是:

--------------------------------------------------------------------------                           
2 WARNING: It appears that your OpenFabrics subsystem is configured to only                            
3 allow registering part of your physical memory.  This can cause MPI jobs to                          
4 run with erratic performance, hang, and/or crash.                                                    
5                                                                                                      
6 This may be caused by your OpenFabrics vendor limiting the amount of                                 
7 physical memory that can be registered.  You should investigate the                                  
8 relevant Linux kernel module parameters that control how much physical                               
9 memory can be registered, and increase them to allow registering all                                 
10 physical memory on your machine.                                                                     
11                                                                                                      
12 See this Open MPI FAQ item for more information on these Linux kernel module                         
13 parameters:                                                                                          
14                                                                                                      
15     http://www.open-mpi.org/faq/?category=openfabrics#ib-locked-pages                                
16                                                                                                      
17   Local host:              tamnun                                                                    
18   Registerable memory:     32768 MiB                                                                 
19   Total memory:            98294 MiB                                                                 
20                                                                                                      
21 Your MPI job will continue, but may be behave poorly and/or hang.                                    
22 --------------------------------------------------------------------------                           
23 --------------------------------------------------------------------------        

然后我从我的代码中得到一个输出,它告诉我它认为我只启动了代码的 1 个实现(Nprocs = 1 而不是 16)。

177                                                                                                      
178 # MPI IS ON; Nprocs = 1                                                                              
179 Filename = ../input/odtParam.inp                                                                     
180                                                                                                      
181 # MPI IS ON; Nprocs = 1                                                                              
182                                                                                                      
183 ***** Error, process 0 failed to create ../data/data_0/, or it was already there

最后,第二条警告信息是:

185 --------------------------------------------------------------------------                           
186 An MPI process has executed an operation involving a call to the                                     
187 "fork()" system call to create a child process.  Open MPI is currently                               
188 operating in a condition that could result in memory corruption or                                   
189 other system errors; your MPI job may hang, crash, or produce silent                                 
190 data corruption.  The use of fork() (or system() or other calls that                                 
191 create child processes) is strongly discouraged.                                                     
192                                                                                                      
193 The process that invoked fork was:                                                                   
194                                                                                                      
195   Local host:          tamnun (PID 17446)                                                            
196   MPI_COMM_WORLD rank: 0                                                                             
197                                                                                                      
198 If you are *absolutely sure* that your application will successfully                                 
199 and correctly survive a call to fork(), you may disable this warning                                 
200 by setting the mpi_warn_on_fork MCA parameter to 0.                                                  
201 --------------------------------------------------------------------------     

在网上看了一圈后,我尝试按照警告消息的建议将MCA 参数mpi_warn_on_fork 设置为0 使用命令:

nohup mpirun --mca mpi_warn_on_fork 0 -np 16 ./my_exec > log.txt &

产生以下错误消息:

[mpiexec@tamnun] match_arg (./utils/args/args.c:194): unrecognized argument mca
[mpiexec@tamnun] HYDU_parse_array (./utils/args/args.c:214): argument matching returned error
[mpiexec@tamnun] parse_args (./ui/mpich/utils.c:2964): error parsing input array
[mpiexec@tamnun] HYD_uii_mpx_get_parameters (./ui/mpich/utils.c:3238): unable to parse user arguments

我正在使用 RedHat 6.7(圣地亚哥)。我联系了 HPC 部门,但由于我在大学,这个问题可能需要一两天的时间才能回复。任何帮助或指导将不胜感激。

针对回答进行编辑:

确实,我使用 Open MPI 的 mpic++ 编译我的代码,同时使用 Intel 的 mpirun 命令运行可执行文件,因此出现错误(操作系统升级后 Intel 的 mpirun 被设置为默认值)。我不得不将 Open MPI 的 mpirun 路径放在 $PATH 环境变量的开头。

代码现在按预期运行但我仍然收到上面的第一条警告消息(它不建议我再使用MCA 参数mpi_warn_on_fork。我认为(但不确定)这是我需要解决的问题与 HPC 部门解决。

【问题讨论】:

  • 你在逗号中有一个错字是:mpi_warn_on_fork(你写了工作)
  • 哈对,我用的命令没错,错字是发帖的问题。

标签: c++ linux mpi


【解决方案1】:
[mpiexec@tamnun] match_arg (./utils/args/args.c:194): unrecognized argument mca
[mpiexec@tamnun] HYDU_parse_array (./utils/args/args.c:214): argument matching returned error
[mpiexec@tamnun] parse_args (./ui/mpich/utils.c:2964): error parsing input array
                                  ^^^^^
[mpiexec@tamnun] HYD_uii_mpx_get_parameters (./ui/mpich/utils.c:3238): unable to parse user arguments
                                                  ^^^^^

您在最后一种情况下使用 MPICH。 MPICH 不是 Open MPI,它的进程启动器无法识别特定于 Open MPI 的 --mca 参数(MCA 代表模块化组件架构 - Open MPI 所基于的基本框架)。多个 MPI 实现混合的典型案例。

【讨论】:

  • 感谢您的回答!但是,我确定从哪里开始修复它。有什么建议吗?
  • 首先找出机器上安装了哪些 MPI 实现以及如何在它们之间切换。此外,请确保您使用来自用于编译程序的同一实现的mpirun。针对 Open MPI 进行编译并使用 MPICH 运行时运行(反之亦然)根本不起作用,因此您会得到一堆单例进程,正如您已经观察到的,它们在自己的 MPI_COMM_WORLDs 中的等级均为 0。
  • 查看我的编辑。我会接受你的回答,因为它让我走上了正轨(一旦诊断出问题,解决方案就很容易了)。
  • 不是,是关于InfiniBand模块的配置。每个 InfiniBand 适配器都有自己的虚拟到物理地址转换单元 (MMU),类似于 CPU 中的那个。它允许适配器通过称为内存注册的进程直接使用进程虚拟地址而不是物理地址,这极大地简化了 API,因为许多事情都可以从用户空间完成。但要使其工作,InfiniBand 上的 MMU 必须有足够的转换表条目来覆盖整个 RAM。这通常由内核模块的参数控制。
  • 注册内存是一个两步过程。首先,必须通过锁定数据将数据固定在物理内存中,因此您需要通过ulimit -l unlimited 取消对锁定内存的限制。然后,InfiniBand 驱动程序构建描述物理内存位置的转换表条目。如果表没有足够的条目,驱动程序将无法同时注册足够的物理内存,如果您的应用程序正在发送大量数据,这可能会导致问题。这只是一个警告,大多数程序将按原样运行。
猜你喜欢
  • 2017-05-13
  • 1970-01-01
  • 2019-07-14
  • 2013-08-09
  • 2015-02-17
  • 1970-01-01
  • 1970-01-01
  • 2019-05-16
  • 2013-06-11
相关资源
最近更新 更多