10.8. 使用LSF启动

Open MPI 支持 LSF 资源管理器。

10.8.1. 验证LSF支持

prte_info 命令可用于确定已安装的 Open MPI 是否包含 LSF 支持:

shell$ prte_info | grep lsf

如果Open MPI安装包含对LSF的支持,您应该会看到类似下面的行。请注意,MCA版本信息会根据安装的Open MPI版本而有所不同。

MCA ras: lsf (MCA v2.1.0, API v2.0.0, Component v3.0.0)

注意

PRRTE是为Open MPI提供运行时环境支持的软件层。Open MPI通常对终端用户隐藏了大部分PMIx和PRRTE的细节,但在这里Open MPI无法掩盖PRRTE(而非Open MPI本身)提供此功能的事实。因此,用户需要使用prte_info命令来检查LSF支持(而非ompi_info)。

10.8.2. 启动

当正确配置时,Open MPI会直接从LSF获取主机列表以及每台主机上需要启动的进程数量。因此,无需为--hostfile--host-n选项指定参数给mpirun。Open MPI将使用LSF原生机制来启动和终止进程(不需要ssh)。

例如:

# Allocate a job using 4 nodes with 2 processors per node and run the job on the nodes allocated by LSF
shell$ bsub -n 8 -R "span[ptile=2]" "mpirun mpi-hello-world"

这将在由LSF分配的节点上运行MPI进程。或者,如果提交的是脚本:

shell$ cat my_script.sh
#!/bin/sh
mpirun mpi-hello-world
shell$ bsub -n 8 -R "span[ptile=2]" < my_script.sh