【发布时间】:2014-07-22 04:55:21
【问题描述】:
我正在尝试在 PBS 资源管理下的集群上运行 MPI 作业。集群指南说我不应该担心将任何东西传递给mpiexec,因为 PBS 应该会处理这个问题。对于单个节点上的作业,这是正确的,并且作业运行完美。
当我提交需要多个节点的作业时,作业退出时说它无法识别主机。我在我的 PBS 脚本中包含了一个例程来解析 $PBS_NODEFILE,并使用正确的 DNS 后缀重建主机文件。 PBS 现在可以识别主机。
现在是令人不安的部分:我生成的主机文件没有正确传递给mpiexec。请参阅下面的主机文件,以及 MPI 进程的输出。
我的主机文件:
cx1-25-2-2.cx1.hpc.ic.ac.uk
cx1-25-2-2.cx1.hpc.ic.ac.uk
cx1-25-2-2.cx1.hpc.ic.ac.uk
cx1-25-2-2.cx1.hpc.ic.ac.uk
cx1-25-2-2.cx1.hpc.ic.ac.uk
cx1-25-2-2.cx1.hpc.ic.ac.uk
cx1-25-2-2.cx1.hpc.ic.ac.uk
cx1-25-2-2.cx1.hpc.ic.ac.uk
cx1-25-2-2.cx1.hpc.ic.ac.uk
cx1-25-2-2.cx1.hpc.ic.ac.uk
cx1-25-2-2.cx1.hpc.ic.ac.uk
cx1-25-3-1.cx1.hpc.ic.ac.uk
cx1-25-3-1.cx1.hpc.ic.ac.uk
cx1-25-3-1.cx1.hpc.ic.ac.uk
cx1-25-3-1.cx1.hpc.ic.ac.uk
cx1-25-3-1.cx1.hpc.ic.ac.uk
cx1-25-3-1.cx1.hpc.ic.ac.uk
cx1-25-3-1.cx1.hpc.ic.ac.uk
cx1-25-3-1.cx1.hpc.ic.ac.uk
cx1-25-3-1.cx1.hpc.ic.ac.uk
cx1-25-3-1.cx1.hpc.ic.ac.uk
cx1-25-3-1.cx1.hpc.ic.ac.uk
cx1-25-3-1.cx1.hpc.ic.ac.uk
MPI 进程的输出:
Host : "cx1-25-2-2.cx1.hpc.ic.ac.uk"
PID : 32752
nProcs : 24
Slaves :
23
(
"cx1-25-2-2.cx1.hpc.ic.ac.uk.32753"
"cx1-25-2-2.cx1.hpc.ic.ac.uk.32754"
"cx1-25-2-2.cx1.hpc.ic.ac.uk.32755"
"cx1-25-2-2.cx1.hpc.ic.ac.uk.32756"
"cx1-25-2-2.cx1.hpc.ic.ac.uk.32757"
"cx1-25-2-2.cx1.hpc.ic.ac.uk.32758"
"cx1-25-2-2.cx1.hpc.ic.ac.uk.32759"
"cx1-25-2-2.cx1.hpc.ic.ac.uk.32760"
"cx1-25-2-2.cx1.hpc.ic.ac.uk.32761"
"cx1-25-2-2.cx1.hpc.ic.ac.uk.32762"
"cx1-25-2-2.cx1.hpc.ic.ac.uk.32763"
"cx1-25-2-2.cx1.hpc.ic.ac.uk.32764"
"cx1-25-2-2.cx1.hpc.ic.ac.uk.32765"
"cx1-25-2-2.cx1.hpc.ic.ac.uk.32766"
"cx1-25-2-2.cx1.hpc.ic.ac.uk.32767"
"cx1-25-2-2.cx1.hpc.ic.ac.uk.316"
"cx1-25-2-2.cx1.hpc.ic.ac.uk.319"
"cx1-25-2-2.cx1.hpc.ic.ac.uk.320"
"cx1-25-2-2.cx1.hpc.ic.ac.uk.321"
"cx1-25-2-2.cx1.hpc.ic.ac.uk.322"
"cx1-25-2-2.cx1.hpc.ic.ac.uk.323"
"cx1-25-2-2.cx1.hpc.ic.ac.uk.324"
"cx1-25-2-2.cx1.hpc.ic.ac.uk.325"
)
进程列表是否应该与主机文件相同?为什么mpiexec 不接受主机文件?
实现是 OpenMPI 1.6.0,我的 PBS 脚本的 MWE 如下:
#!/bin/sh
#PBS -l walltime=40:00:00
#PBS -l select=2:ncpus=12:mpiprocs=24:mem=4gb
module load openfoam/2.3.0 libscotch
pbsdsh2 cp -r $INPUT_DIR $TMPDIR/ 2>&1
# setting up hosts file
sed -n 1~24p $PBS_NODEFILE > hosts_buffer
for ii in `cat hosts_buffer`; do echo ${ii}.cx1.hpc.ic.ac.uk slots=12; done > hosts
nprocs=24;
# execution
mpiexec --hostfile hosts -np $nprocs $SOLVER 2>&1
【问题讨论】:
-
请同时包含您的 pbs 脚本
-
您使用哪种 MPI 实现?它是通过所谓的与 PBS 的紧密集成编译的吗? Open MPI 可以在支持
tm(PBS API)的情况下进行编译,因此它可以使用tm接口来获取有关主机列表的信息并在远程节点上启动进程。要检查您的 MPI 是否为 Open MPI,只需发出:mpicc --showme:version,它应该会打印 Open MPI 的版本。 -
MPI 实现是 OpenMPI 1.6.0。 - 我没有运行
mpicc --showme:version,因为如果不在 PBS 环境中它不会运行并且队列很长,但是我加载了模块并看到$MPI_ARCH_PATH和$MPI_LIBS指向 OpenMPI 1.6 的位置。 0。至于编译标志,一个快速的ompi_info | grep tm显示 MCA ras: tm (MCA v2.0, API v2.0, Component v1.6) MCA plm: tm (MCA v2.0, API v2.0, Component v1. 6) MCA ess: tm (MCA v2.0, API v2.0, 组件 v1.6)
标签: mpi cluster-computing hpc pbs