Answer

问题及解答

作业提交流程

Posted by haifeng on 2013-10-30 17:27:14 last update 2013-11-01 16:31:35 | Edit | Answers (0)

  1. 在自己的工作目录下运行 genQue 命令, 可以得到 Job_que.sh 文件.
  2. 编辑 Job_que.sh
  3. 使用 qsub Job_que.sh 提交作业.

genQue 位于 /opt/HPCconfig/bin/genQue

# which genQue
/opt/HPCconfig/bin/genQue
 
# genQue
 

编辑 genQue, 其内容是

#!/bin/bash

#-----------------------------------
# Name: genQue
#-----------------------------------
# Script is used to Create PBS job submitting shell script
#-----------------------------------
#-- Created by ...
#-- Updated by ...
# 
#-----------------------------------

ShellName="genQue"
LogFile="/opt/HPCconfig/log/installlog/$ShellName.log"


HOMEDIR=/home/
BINDIR=/opt/HPCconfig/bin/
SBINDIR=/opt/HPCconfig/sbin/
ETCDIR=/opt/HPCconfig/etc/
NodeList=/opt/HPCconfig/sysconfig/nodes
QueFile=/opt/HPCconfig/etc/queue/Que.pbs

#----------------------------------------------------------

QueName=Job_que.sh

#------ Create PBS job script file 
touch $QueName
cat $QueFile > $QueName

#------ Change File owner config
chmod +x $QueName
chown $USERNAME:$USERNAME $QueName

 

 

生成的文件 Job_que.sh 实际上是 的具体内容是 /opt/HPCconfig/etc/queue/Que.pbs 中的内容, 具体如下

#!/bin/sh

#PBS -N JOB
#PBS -l nodes=1:ppn=8
#PBS -l feature=xe
#PBS -l naccesspolicy=singlejob
#PBS -o RunJob.out
#PBS -e RunJob.err
#PBS -l walltime=120:00:00  ## ( 表示如果运行时间超过 120 小时, 则作业将被自动停止. )
#PBS -q batch

echo --------- `date` ----------

echo HomeDirectory is $PWD
echo
echo Current Dir is $PBS_O_WORKDIR
echo


cd $PBS_O_WORKDIR

echo "------------This is the node file -------------"
cat $PBS_NODEFILE
echo "-----------------------------------------------"
cat $PBS_NODEFILE > host.mpd


np=$(cat $PBS_NODEFILE | wc -l)
echo The number of core is $np
echo
echo

#-----------------------------------------------------#
#    OpenMPI Job Submitting Example    #
#    
#    mpirun -np $np -machinefile host.mpd $BINPATH ...
#
#
#-__--------------------------------------------------#
#            -__-  have fun!     #