【问题标题】:How could I run Open MPI under Slurm我如何在 Slurm 下运行 Open MPI
【发布时间】:2019-03-20 07:40:48
【问题描述】:

我无法通过Slurm-scriptSlurm 下运行Open MPI

一般来说,我可以获取主机名并在我的机器上运行Open MPI

$ mpirun hostname
myHost
$ cd NPB3.3-SER/ && make ua CLASS=B && mpirun -n 1 bin/ua.B.x inputua.data # Works

但如果我通过 slurm-script mpirun hostname 执行相同的操作,则返回空字符串,因此我无法运行 mpirun -n 1 bin/ua.B.x inputua.data

slurm-script.sh:

#!/bin/bash
#SBATCH -o slurm.out        # STDOUT
#SBATCH -e slurm.err        # STDERR
#SBATCH --mail-type=ALL

export LD_LIBRARY_PATH="/usr/lib/openmpi/lib"
mpirun hostname > output.txt # Returns empty
cd NPB3.3-SER/ 
make ua CLASS=B 
mpirun --host myHost -n 1 bin/ua.B.x inputua.data
$ sbatch -N1 slurm-script.sh
Submitted batch job 1

我收到的错误:

There are no allocated resources for the application
  bin/ua.B.x
that match the requested mapping:    
------------------------------------------------------------------
Verify that you have mapped the allocated resources properly using the
--host or --hostfile specification.

A daemon (pid unknown) died unexpectedly with status 1 while attempting
to launch so we are aborting.

There may be more information reported by the environment (see above).

This may be because the daemon was unable to find all the needed shared
libraries on the remote node. You may set your LD_LIBRARY_PATH to have the
location of the shared libraries on the remote nodes and this will
automatically be forwarded to the remote nodes.
------------------------------------------------------------------
mpirun noticed that the job aborted, but has no info as to the process
that caused that situation.
------------------------------------------------------------------
An ORTE daemon has unexpectedly failed after launch and before
communicating back to mpirun. This could be caused by a number
of factors, including an inability to create a connection back
to mpirun due to a lack of common network interfaces and/or no
route found between them. Please check network connectivity
(including firewalls and network routing requirements).
------------------------------------------------------------------

【问题讨论】:

  • 完全删除--host myHost 选项。如果 SLURM 是使用 OpenMPI 集成编译的,它将能够将分配的节点列表隐式传递给 mpirun。
  • 我已经删除了--host myHost,但我仍然遇到同样的错误。我将 SLURM 编译如下./configure --enable-debug --enable-front-end && make && make install。如何使用 OpenMPI 集成编译 SLURM? @DmitriChubarov
  • 你能提供 slurm 和 openmpi 版本吗?
  • 如果通过slurm 运行hostname(不是mpirun hostname)会得到什么?这可以区分openmpi 是否涉及该问题。我的猜测很可能 openmpi 与 output.txt 为空无关(我不知道这是您遇到的唯一问题,还是第一个出现的问题)。
  • 如果我通过slurm 运行hostname,它会返回ebloc,这实际上也是slurm.conf 上的NodeHostName。 @sancho.s

标签: openmpi slurm sbatch


【解决方案1】:

如果 Slurm 和 OpenMPI 是最新版本,请确保使用 Slurm 支持编译 OpenMPI(运行 ompi_info | grep slurm 以查找)并在提交脚本中运行 srun bin/ua.B.x inputua.data

或者,mpirun bin/ua.B.x inputua.data 也应该可以工作。

如果在没有 Slurm 支持的情况下编译 OpenMPI,则以下内容应该可以工作:

srun hostname > output.txt
cd NPB3.3-SER/ 
make ua CLASS=B 
mpirun --hostfile output.txt -n 1 bin/ua.B.x inputua.data

还要确保通过运行export LD_LIBRARY_PATH="/usr/lib/openmpi/lib" 不会覆盖其他必要的库路径。更好的可能是export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/lib/openmpi/lib"(或者a more complex version,如果你想避免领先的:,如果它最初是空的。)

【讨论】:

  • 我仍然遇到与mpirun bin/ua.B.x inputua.data 的问题相同的错误。我已更新LD_LIBRARY_PATH,不幸的是srun 不起作用。我可以毫无问题地运行bin/sp.B.x inputsp.data。 // $ srun hostname > output.txt => srun: error: srun task launch not supported on this system // $ ompi_info | grep slurm => MCA ras: slurm (MCA v2.0, API v2.0, Component v1.6.5) MCA plm: slurm (MCA v2.0, API v2.0, Component v1.6.5) MCA ess: slurm (MCA v2.0, API v2.0, Component v1.6.5) MCA ess: slurmd (MCA v2.0, API v2.0, Component v1.6.5)
  • 如果您在 slurm.conf 中定义了 FrontEnd,请将其删除。
  • 我来宾 FrontEnd 未定义,//cat /usr/local/etc/slurm.conf | grep "FrontEnd" 返回空行。 @damienfrancois
  • 然后检查slurm.conf 文件中的名称是否与服务器的名称匹配(hostname -s)。还要确保slurm.conf 在所有机器上都相同?
  • 目前我在一台机器上使用 Slurm 并且能够通过sbatch 提交作业,但不能通过srun 提交作业。 hostname -sslurm.conf 中的 ControlMachineNodeHostName 匹配。请注意,由于我之前遇到的问题 (stackoverflow.com/questions/44719897/…),我无法让 Slurm 在多台机器上工作。
【解决方案2】:

您需要的是:1) 运行 mpirun,2) 从 slurm,3) 使用 --host。 要确定谁应该为这不起作用(问题 1)负责,您可以测试一些东西。 无论您测试什么,您都应该通过命令行 (CLI) 和 slurm (S) 以同样的方式测试完全相同。 据了解,其中一些测试在CLIS的情况下会产生不同的结果。

一些注意事项是: 1) 您没有在 CLI 和 S 中测试完全相同的东西。 2)您说您“无法运行mpirun -n 1 bin/ua.B.x inputua.data”,而问题实际上出在mpirun --host myHost -n 1 bin/ua.B.x inputua.data。 3)mpirun hostname > output.txt 返回一个空文件的事实(问题 2)不一定与您的主要问题具有相同的起源,请参见上面的段落。您可以使用scontrol show hostnames 来解决这个问题 或使用环境变量SLURM_NODELISTscontrol show hostnames 所基于),但这并不能解决问题 1。


要解决不是最重要的问题 2,请通过 CLI 和 S 尝试一些操作。 下面的 slurm 脚本可能会有所帮助。
#SBATCH -o slurm_hostname.out        # STDOUT
#SBATCH -e slurm_hostname.err        # STDERR
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}/usr/lib64/openmpi/lib"

mpirun hostname > hostname_mpirun.txt               # 1. Returns values ok for me
hostname > hostname.txt                             # 2. Returns values ok for me
hostname -s > hostname_slurmcontrol.txt             # 3. Returns values ok for me
scontrol show hostnames > hostname_scontrol.txt     # 4. Returns values ok for me
echo ${SLURM_NODELIST} > hostname_slurmcontrol.txt  # 5. Returns values ok for me

(有关export 命令的说明,请参见this)。 根据您的说法,我了解 2、3、4 和 5 对您来说可以,而 1 则不行。 所以你现在可以使用mpirun 和合适的选项--host--hostfile

注意scontrol show hostnames(例如,对我来说是cnode17<newline>cnode18)和echo ${SLURM_NODELIST}cnode[17-18])输出的不同格式。

主机名也可以通过%h%nslurm.conf中动态设置的文件名中获得,例如查找SlurmdLogFile, SlurmdPidFile.


要诊断/解决/解决问题 1,请尝试在 CLI 和 S 中使用/不使用 --hostmpirun。 根据您所说,假设您在每种情况下都使用了正确的语法,结果如下:
  1. mpirun,CLI(原始帖子)。 “作品”。

  2. mpirun, S(评论?)。 与以下第 4 项相同的错误? 请注意,S 中的mpirun hostname 应该在您的slurm.err 中产生类似的输出。

  3. mpirun --host,CLI(评论)。 错误

    There are no allocated resources for the application bin/ua.B.x that match the requested mapping:
    ...
    This may be because the daemon was unable to find all the needed shared
    libraries on the remote node. You may set your LD_LIBRARY_PATH to have the
    location of the shared libraries on the remote nodes and this will
    automatically be forwarded to the remote nodes.
    
  4. mpirun --host, S(原帖)。 错误(与上面的第 3 项相同?)

    There are no allocated resources for the application
      bin/ua.B.x
    that match the requested mapping:    
    ------------------------------------------------------------------
    Verify that you have mapped the allocated resources properly using the
    --host or --hostfile specification.
    ...
    This may be because the daemon was unable to find all the needed shared
    libraries on the remote node. You may set your LD_LIBRARY_PATH to have the
    location of the shared libraries on the remote nodes and this will
    automatically be forwarded to the remote nodes.
    

根据 cmets,您可能设置了错误的 LD_LIBRARY_PATH 路径。 您可能还需要使用mpi --prefix ...

相关? https://github.com/easybuilders/easybuild-easyconfigs/issues/204

【讨论】:

  • $ scontrol show hostnames => scontrol: error: host list is empty $ echo ${SLURM_NODELIST} # Returns empty 除此之外,我还运行了slurm_test.slurmhostname_mpirun.txt 未创建。 $ cat hostname_slurmcontrol.txt => ebloc $ cat hostname.txt => ebloc
  • @alper - 我的意思是在 slurm 中获取 scontrol 的输出,而不是命令行。请发布slurm_hostname.out的内容。我希望在那里找到主机名。另外,hostname 似乎正确输出了主机名。
  • $ cat slurm.out => ebloc1 ebloc1
  • @alper - 将其用作mpirun 的主机名还不够吗?您的预期输出是什么?
  • 我已将myHost 更新为ebloc1,但我仍然遇到同样的错误。请深入查看错误:gist.github.com/avatar-lavventura/…。我认为正如@damienfrancois 建议的那样,我需要在没有--enable-front-end 标志的情况下重新编译slurm,然后再试一次。
猜你喜欢
  • 2013-06-04
  • 2017-03-14
  • 1970-01-01
  • 2016-01-01
  • 1970-01-01
  • 2020-03-05
  • 2020-09-27
  • 2015-12-27
  • 2011-07-11
相关资源
最近更新 更多