我正尝试在PBS资源管理下的集群上运行MPI作业。集群指南说,我不应该担心把任何东西传递给mpiexec,因为PBS应该会处理这个问题。对于单个节点上的作业,这是正确的,并且作业运行良好。
当我提交需要多个节点的作业时,作业退出,并表示无法识别主机。我在PBS脚本中包含了一个例程来解析$PBS_NODEFILE,并使用正确的DNS后缀重新构建主机文件。PBS现在可以识别主机。
现在问题来了:我生成的主机文件没有正确地传递给mpiexec。有关我传递的hosts文件和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.ukMPI过程的输出:
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发布于 2014-06-24 18:02:10
我想你需要跳过12行
sed -n 1~12p $PBS_NODEFILE > hosts_buffer或
uniq $PBS_NODEFILE > hosts_buffer我还注意到你的主机文件只有23行。
您也可以这样尝试:
cd $PBS_O_WORKDIR
mpiexec -hostfile $PBS_NODEFILE -np `wc -l < $PBS_NODEFILE` $SOLVER 2>&1发布于 2014-06-26 19:13:10
我认为这个问题与你的PBS指令有关。
尝试从以下位置更改:
#PBS -l select=2:ncpus=12:mpiprocs=24:mem=4gb至:
#PBS -l select=2:ncpus=12:mpiprocs=12:mem=4gb这样,您可以请求PBS为每个节点派生12个进程,而不是之前的24个进程。我不认为您需要重新生成主机文件。只需按如下方式运行代码:
mpiexec -hostfile $PBS_NODEFILE -np 24 $SOLVER 2>&1希望这样就可以了。
https://stackoverflow.com/questions/23988336
复制相似问题