1. 研究所目前使用的作业及计算资源管理引擎是SGE 系统。这一作业管理系统支持用户票证及高级作业调度等多种策略,能够与较多软件的作业递交模板进行预设置绑定。 b1.q 1TB 主机服务队列,用作 ssh 调度 (公共)
docker.q docker 主机队列 (邀请)
g1.q 公共服务队列1 (公共)
g2.q 公共服务队列2 (公共)
g3.q 公共服务队列3 (公共)
g4.q 公共服务队列4 (公共)
gpu.q GPU 服务队列 (邀请)
largesmp.q 6TB服务器队列 (邀请)
u1.q 紧急队列 (邀请)
2. SGE 基本命令: 查看所有队列队列: qconf –sql
查看特定队列: qstat –f –q queuename -u '*'
查看所有计算节点: qhost
查看某个任务: qstat –j job-number
删除任务: qdel job-number
查看并行环境: qconf –spl
SGE 在任务执行时候会生成两个文件 .o 是所有正常output 文件, .e 是包含所有错误信息的文件。
3. 作业调度策略:
采用FIFO 的基本策略和用户票证相结合。票证多的用户优先级高,在相同票证情况下,先入队列优先级别高。并行任务优先级别要高于串行任务。
4. 零时文件目录:
请在SGE 执行脚本中尽量使用$TMP 参数,并用作于存放零时文件。作为读写频繁操作的目录。作业调度引擎会在作业完成后自动回收和删除这些零时文件。
5. 交互式作业:
对于如MATLAB, R 等需要交互式环境下使用的特殊作业,用户需要使用
qrsh -l mem_req=2g -q queuename
其中, mem_req 为任务需要的最小内存。作业调度引擎会按照需求自动分配节点。
6. 可以申请的请求资源参数
可以详细参见complex(5) or queue_conf(5)。在执行脚本中,或者在qsub 任务递交的时候使用-l resource=value,… 来传递需要调度的资源变量。其中经常用到的包括:
qname : 队列名称
hostname : 主机名称
tmpdir : $tmp 零时目录位置,缺省情况下用/var/tmp
slots : 同时并行执行任务数量
mem_free: 空余内存数量
pe : 并行环境变量
7. 串行任务执行脚本
#!/bin/sh
###################################################################
#
# A (quite) simple submit script for a one or two processor job
#
###################################################################
#
# SGE options:
#
# Change to the current working directory upon starting of the job #$ -cwd
# Specify the kind of shell script you use, for example, bash
#$ -S /bin/bash
# join the error and standard output streams
#$ -j y
#
# set the required cpu time of your job
#$ -l h_cpu=hh:mm:ss
#
# don't flood myself with e-mail
#$ -m n
#
# this is my e-mail address
#$ -M username@sibcb.ac.cn
#
# notify me about pending SIG_STOP and SIG_KILL
#$ -notify
#
# name of the job
#$ -N MyJob
#
# end of SGE stuff
###################################################################
# now execute my job:
date
sleep 60
date
# end of job script
在递交节点上采用:
“qsub –q queuename your script” 命令递交
8. 并行计算模板
#!/bin/sh
################################################################### #
# A (quite) simple submit script for a job using a parallel
# environment
#
################################################################### #
# SGE options:
#
# Change to the current working directory upon starting of the job
#$ -cwd
#
# Specify the kind of shell script you use, for example, bash
#$ -S /bin/bash
#
# join the error and standard output streams
#$ -j y
#
# set the required cpu time of your job
#$ -l h_cpu=hh:mm:ss
#
# MPIR_HOME from submitting environment
#$ -v MPIR_HOME=/sibcb/program/install/mpich-3.0.4
#
# use the parallel environment mpich with 8 processors
#$ -pe orte 2-8
#
# do_not_attempt to request num_proc here, or your job may not
# run, since num_proc is only a local resource.
#
# don't flood myself with e-mail
#$ -m n
#
# this is my e-mail address
#$ -M username@sibcb.ac.cn
#
# notify me about pending SIG_STOP and SIG_KILL
#$ -notify
#
# name of the job
#$ -N MyJob
#
# end of SGE stuff
####################################################################
now execute my job:
$MPIR_HOME/bin/mpirun -np $NSLOTS my_parallel_program.mpich
# end of job script
在递交节点上采用:
“qsub –pe XXX(pename) your script”方式递交