PBS(Portable BatchSystem)簡介

PBS(Portable BatchSystem)簡介

PBS(Portable Batch System)最初由NASA的Ames研究中心開發,主要爲了提供一個能滿足異構計算網絡需要的軟件包,用於靈活的批處理,特別是滿足高性能計算的需要,如集羣系統、超級計算機和大規模並行系統。PBS的主要特點有:代碼開放,免費獲取;支持批處理、交互式作業和串行、多種並行作業,如MPI、PVM、HPF、MPL;PBS是功能最爲齊全, 歷史最悠久, 支持最廣泛的本地集羣調度器之一。 PBS的目前包括openPBS, PBS Pro和Torque三個主要分支. 其中OpenPBS是最早的PBS系統, 目前已經沒有太多後續開發,PBS pro是PBS的商業版本, 功能最爲豐富. Torque是Clustering公司接過了OpenPBS, 並給與後續支持的一個開源版本.

PBS的應用不同於一般的直接運行:mpirun –np number ./executable_file

直接運行上句,則只能在單個節點上進行並行計算。如果要在多個節點上並行執行則要寫machinefile或p4pgfile,兩種文件的具體寫法參考張林波等《並行計算導論》。運行命令分別爲:

       mpirun–machinefile filename

       mpirun–p4pg filename

應用PBS提交任務則會形成任務隊列,依次執行,有效分配資源,避免資源競爭。否則CPU時間片會輪流分配給各個人的任務,從而影響所有人的正常作業。

torque PBS 的安裝配置及使用

torque PBS 提供對批處理作業和分散的計算節點(Compute nodes)的控制。

安裝Torque組件:在一個節點上(head node)安裝pbs_server【服務器—主節點】,所有計算節點上安裝pbs_mom,所有計算節點和提交節點上安裝PBS客戶端【什麼叫pbs客戶端?】。至少做最基本的配置,使Torque系統跑起來,也就是使pbs_server能知道該和哪些機器通話。

在pbs_server上創建一個作業提交隊列【什麼叫作業提交隊列?】。

在集羣的所有節點上指定一個cluster name作爲property【指定同一的集羣名稱?】。這可以用qmgr命令做到。比如:

                 qmgr -c "set node node properties=cluster-name"。

確保作業可以提交到節點上去。這可以通過使用qsub命令做到。比如:

                echo "sleep 30" | qsub -l nodes=3。

 



一、Torque安裝(在master管理結點上【又稱爲主節點、服務器?】)


1. 解壓安裝包

tar -zxvf torque-2.3.0.tar.gz

2. 進入到解壓後的文件夾

./configure –prefix=/usr/torque --with-default-server=keylab2

make

make install

3. 打包,<user>必須是個普通用戶【爲什麼必須是普通用戶,針對普通用戶產生的包,可用於所有普通用戶】

1) [root@master torque-2.3.0]#./torque.setup yexq

2) [root@master torque-2.3.0]# make packages

把產生的tpackages , torque-package-clients-linux-x86-64.sh, torque-package-mom-linux-x86-64.sh拷貝到所有節點。

3) 客戶端安裝【提交任務的機器上安裝,一般到主節點上提交任務】

在keylab2上執行

[root@master torque-2.3.0]# ./torque-package-server-linux-x86_64.sh --install

[root@master torque-2.3.0]# ./torque-package-clients-linux-x86_64.sh--install

[root@master torque-2.3.0]# ./torque-package-mom-linux-x86_64.sh --install

4)加入運算節點、修改/etc/hosts文件

編輯/var/spool/torque/server_priv/nodes (需要自己建立)加入如下內容

keylab2 np=24

 

修改/etc/hosts文件

[root@keylab2 vasp]# cat /etc/hosts

192.168.1.100 keylab1

192.168.1.102 keylab2

 

root@xiaoqiugood:~# cat /etc/hosts

#

# hosts         This file describes a number ofhostname-to-address

#               mappings for the TCP/IPsubsystem.  It is mostly

#               used at boot time, when no nameservers are running.

#               On small systems, this file canbe used instead of a

#               "named" nameserver.  Just add the names, addresses

#               and any aliases to this file...

#

# By the way, Arnt Gulbrandsen<[email protected]> says that 127.0.0.1

# should NEVER be named with the name ofthe machine.  It causes problems

# for some (stupid) programs, irc andreputedly talk. :^)

#

# For loopbacking.

127.0.0.1               localhost

127.0.0.1               xiaoqiugood.xiaoqiugood.orgxiaoqiugood

 

# End of hosts.

 

    修改服務器上的/etc/hosts文件,確保由主機名字到IP地址的正確翻譯。

127.0.0.1 localhost localhost.localdomain  保留localhost域名供沒有連網時使用

192.168.0.254 server1.example.com  server1

192.168.0.1 station1.example.com   station1

192.168.0.2 station2.example.com   station2  

4)-I  配置 服務器名、mom進程配置文件

a)設置服務器名(主節點的名字):編輯/var/spool/torque/server_name文件,填寫本機機器名(如keylab2)

b)設置MOM進程配置文件:編輯 /var/spool/torque/mom_priv/config文件,寫入如下內容
$logevent0×1ff
$clienthost keylab2

 

4) –II環境變量設置及首次啓動PBS(注意順序)

LD_LIBRARY_PATH=/usr/torque/lib:$LD_LIBRARY_PATH

PATH=/usr/torque/bin: /usr/torque/sbin:$PATH

a)     啓動mom進程:(任意路徑下)執行命令  pbs_mom
b)啓動調度器進程:執行命令 pbs_sched

root@keylab2 torque]# pbs_sched

pbs_sched: LOG_ERROR::Address already inuse (98) in main, bind


c)啓動OpenPBS服務器進程,創建pbs數據庫
執行命令  pbs_server -t  create
其參數 -t  create 只在首次啓動server進程時才需要

 

pbs_server: network: Address already in use

PBS_Server: LOG_ERROR::PBS_Server,init_network failed dis

 

4)-III 設置成開機自啓動

[root@keylab2 vasp]# cat /etc/rc.local

#!/bin/sh

#

# This script will be executed *after* allthe other init scripts.

# You can put your own initialization stuffin here if you don't

# want to do the full Sys V style initstuff.

touch /var/lock/subsys/local

/usr/torque/sbin/pbs_server -a true

 /usr/torque/sbin/pbs_sched

 /usr/torque/sbin/pbs_mom

4)-IV 將PBS做成系統服務,以便隨時啓動、關閉它

 

a編輯/etc/pbs.conf文件,填入如下內容:

 

#tecture and comment out the "SAMPLEFILE" line below

#SAMPLE FILE

# MPD_SECRETWORD=123456

#secretword=yexiaoqiu123456

export pbs_home=/var/spool/torque

export pbs_exec=/usr/torque/

start_server=1

start_sched=1

start_mom=1

 

b)       將OpenPBS解壓目錄中的……/src/tools/init.d/pbs文件複製到/etc/init.d/pbs
c)        執行命令chkconfig --add pbs
d)        用chkconfig  --list | grep pbs  命令查看pbs服務是否已被加入
e)         現在就可以使用如下命令啓動、關閉pbs了:
i.             啓動pbs:     service pbs start
ii.             關閉pbs:     service pbs stop
iii.             重啓pbs:     service pbsrestart

有錯誤:

[root@keylab1 tools]# service pbs start

Starting PBS

pbs_server: network: Address already in use

PBS_Server: LOG_ERROR::PBS_Server,init_network failed dis

PBS server

tail: cannot open `+2' for reading: No suchfile or directory

pbs_mom: LOG_ERROR::Resource temporarilyunavailable (11) in pbs_mom, cannot lock '/var/spool/torque/mom_priv/mom.lock'- another mom running

cannot lock'/var/spool/torque/mom_priv/mom.lock' - another mom running

PBS mom

tail: cannot open `+2' for reading: No suchfile or directory

pbs_sched: LOG_ERROR::Address already inuse (98) in main, bind

PBS sched

 

在torque源碼包contrib目錄中有一個文件
cp contrib/init.d/pbs_mom /etc/init.d/pbs_mom
chkconfig --add pbs_mom
在所有的機器(pbs服務器和計算節點)上都需要如此設置。

6)創建隊列

qmgr -c "set serverscheduling=true"

qmgr -c "create queue batchqueue_type=execution"

qmgr -c "set queue batch started=true"

qmgr -c "set queue batchenabled=true"

qmgr -c "set queue batchresources_default.nodes=1"

qmgr -c "set queue batchresources_default.walltime=3600"

qmgr -c "set serverdefault_queue=batch"

 

 

qmgr -c "set serverscheduling=true"

qmgr -c "create queue zdsys2queue_type=execution"

qmgr -c "set queue zdsys2started=true"

qmgr -c "set queue zdsys2enabled=true"

qmgr –c "set queue zdsys2resources_max.ncpus =6"

qmgr -c "set queue zdsys2resources_default.nodes=1"

qmgr -c "set queue zdsys2resources_default.walltime=3600000"

qmgr -c "set server default_queue=zdsys2"

 

qmgr -c "set serverscheduling=true"

qmgr -c "create queue super1queue_type=execution"  創建隊列

qmgr -c "set queue super1 started=true"設置隊列

qmgr -c "set queue super1 enabled=true"

qmgr -c "set queue super1resources_max.ncpus = 24"

qmgr -c "set queue super1resources_default.nodes=1"

qmgr -c "set queue super1 resources_default.walltime=3600000"

 

 

qmgr -c "set serverscheduling=true"

qmgr -c "create queue super1queue_type=execution"

qmgr -c "set queue super1 started=true"

qmgr -c "set queue super1 enabled=true"

qmgr -c "set queue super1resources_max.ncpus = 24"

qmgr -c "set queue super1resources_default.nodes=1"

qmgr -c "set queue super1 resources_default.walltime=3600000"

 

 

[root@master ~]# qmgr

create queue students

set queue students queue_type = Execution

set queue students Priority = 40

set queue students resources_max.cput =96:00:00

set queue students resources_min.cput =00:00:01

set queue students resources_default.cput =96:00:00

set queue students enabled = True

set queue students started = True

 

 

你可以試試
set queue long acl_user_enable = True
set queue long acl_users = test1
set queue long acl_users +=test2
這個是往指定的隊列添加指定用戶

set queue long resources_max.ncpus = N
set queue long resources_default.walltime = 100:00:00
set queue long max_user_run = N
set queue long max_queuable = N
set queue long max_user_queuable = N
set queue long max_running = N
上面的是對他一些資源進行限制。。具體含義去查查torque的手冊吧,很詳細的

 

What are the limits regarding multiple processors and machines?

 

Currently, there is a chart that is displayed when you login. If you failed to notice the chart or if it scrolled off the screen, you may display it along with other login messages by using the following argo command:

cat /etc/motd

At some point, that chart will be removed from message of the day file (motd). There are commands that you can use to display queue limits:

  • Maximum number of nodes a student may use in the student_short queue:

qmgr -c "list queue student_short" | grep resources_max.nodect

  • Maximum number of processors a student may request for the job:

qmgr -c "list queue zdsys1" | grep resources_max.ncpus

  • To see other policies (rules) of the student_short queue:

qmgr -c "list queue student_short"

The samples use the student_short queue. You may substitute the name of other queues (student_medium, student_long, staff, dedicated) to get the corresponding settings for them:

  • qmgr -c "list queue staff" | grep resources_max.nodect
  • qmgr -c "list queue staff" | grep resources_max.ncpus
  • qmgr -c "list queue staff"

 

 

7) 驗證配置

 

1.    pbsnodes // 結點信息

[root@keylab1 pbs-software]# pbsnodes

pbsnodes: Server has no node list MSG=nodelist is empty - check 'server_priv/nodes' file

 

似乎是執行這個pbs_server-t  create沖掉了nodes文件

重新編輯後 執行以下操作

[root@keylab1 pbs-software]# qterm

[root@keylab1 pbs-software]# pbs

pbs-config pbsdsh      pbs_mom     pbs_sched  pbs_track  

pbs_demux  pbs_iff     pbsnodes    pbs_server 

[root@keylab1 pbs-software]# pbs

pbs-config pbsdsh      pbs_mom     pbs_sched  pbs_track  

pbs_demux  pbs_iff     pbsnodes    pbs_server 

[root@keylab1 pbs-software]# pbs_server

[root@keylab1 pbs-software]# pbsnodes 執行兩次後顯示

keylab1

    state = down

    np = 24

    ntype = cluster

    mom_service_port = 15002

    mom_manager_port = 15003

    gpus = 0

keylab1

    state = free

    np = 24

    ntype = cluster

    status = rectime=1307431935,varattr=,jobs=,state=free,netload=2635063282,gres=,loadave=12.25,ncpus=24,physmem=66089076kb,availmem=229832984kb,totmem=204558660kb,idletime=310468,nusers=2,nsessions=2,sessions=46024726,uname=Linux keylab1 2.6.32-71.el6.x86_64#1 SMP Wed Sep 1 01:33:01 EDT 2010 x86_64,opsys=linux

    mom_service_port = 15002

    mom_manager_port = 15003

    gpus = 0

2. qmgr-c 'print server' // 隊列信息

3. pbs任務提交腳本及查看任務zhuangt

B  只用於任務向量,表示任務向量已經開始執行 
E  任務在運行後退出 
H  任務被服務器或用戶或者管理員阻塞 
Q  任務正在排隊中,等待被調度運行 
R  任務正在運行 
S  任務被服務器掛起,由於一個更高優先級的任務需要當前任務的資源 
T  任務被轉移到其它執行節點了 
U  由於服務器繁忙,任務被掛起 
W  任務在等待它所請求的執行時間的到來(qsub -a) 
X  只用於子任務,表示子任務完成

再舉一例,使用-a 選項指定任務開始執行時間:

 

Completed jobs will be reported in the C state and the exit status is seen in the job attribute.

 

 

[root@keylab2 vasp]# pbsnodes

keylab2

    state = free

    np = 24

    ntype = cluster

    jobs = 0/5.keylab2, 1/5.keylab2, 2/5.keylab2, 3/5.keylab2, 4/5.keylab2,5/5.keylab2, 6/5.keylab2, 7/5.keylab2, 8/5.keylab2, 9/5.keylab2, 10/5.keylab2,11/5.keylab2, 12/5.keylab2, 13/5.keylab2, 14/5.keylab2, 15/5.keylab2,16/5.keylab2, 17/5.keylab2

    status = rectime=1307302753,varattr=,jobs=5.keylab2,state=free,netload=3171634,gres=,loadave=24.56,ncpus=24,physmem=66089076kb,availmem=21325715656kb,totmem=21858128692kb,idletime=0,nusers=1,nsessions=4,sessions=44116160 7100 7135,uname=Linux keylab2 2.6.32-71.el6.x86_64#1 SMP Wed Sep 1 01:33:01 EDT 2010 x86_64,opsys=linux

    mom_service_port = 15002

    mom_manager_port = 15003

    gpus = 0

 

 

[root@keylab2 vasp]# qmgr -c 'print server'

#

# Create queues and set their attributes.

#

#

# Create and define queue zdsys

#

create queue zdsys

set queue zdsys queue_type = Execution

set queue zdsys resources_default.nodes = 2

set queue zdsys resources_default.walltime= 1000:00:00

set queue zdsys enabled = True

set queue zdsys started = True

#

# Set server attributes.

#

set server scheduling = True

set server acl_hosts = keylab2

set server default_queue = zdsys

set server log_events = 511

set server mail_from = adm

set server scheduler_iteration = 600

set server node_check_rate = 150

set server tcp_timeout = 6

set server next_job_number = 6

 

測試用腳本

[yexq@keylab2 zdsyspbs]$ cat testpbs

#!/bin/sh

#testpbs

#PBS -l nodes=1:ppn=1

#PBS -j oe

#PBS -V

 

echo This is a test

echo Today is `date`

echo This is `hostname`

echo The current working directory is 'pwd'

ls -alF /home

uptime

正式腳本

[yexq@keylab2 zdsyspbs]$ cat pbstest4bb

#!/bin/bash

#PBS -q zdsys2

#PBS -l nodes=1:ppn=18

#PBS -j oe

#PBS -V

#PBS -l walltime=1000:00:00

 

# go to work dir

cd $PBS_O_WORKDIR

 

 

echo $PBS_O_WORKDIR

 

# setup mpd env (Of course use some othersecret word than "dfadfs")

if [ ! -f ~/.mpd.conf ]; then

/bin/echo "secretword=dfadfs">> ~/.mpd.conf

/bin/chmod 600 ~/.mpd.conf

fi

 

 

# Intel MPI Home

MPI_HOME=/opt/mpich2

 

 

 

# setup Nums of Processor

NP=`cat $PBS_NODEFILE|wc -l`

echo "Numbers of Processors:  $NP"

echo"---------------------------"

 

# Number of MPD

N_MPD=`cat $PBS_NODEFILE|uniq|wc -l`

echo "started mpd Number: $N_MPD"

echo"---------------------------"

 

# setup mpi env (em64t)

$MPI_HOME/bin/mpdboot -r ssh -n $N_MPD -f$PBS_NODEFILE

 

 

# running program

nohup $MPI_HOME/bin/mpd &

 

cd /home/yexq/zdsyspbs/c225_opt2b

rm -rf opt-*

./opt.sh

wait

cd ../

# clean

$MPI_HOME/bin/mpdallexit

 

 

 

 

 

/////

# !/bin/bash

#PBS -q zdsys2

#PBS -l nodes=1:ppn=18

#PBS -j oe

#PBS -V

#PBS -l walltime=1000:00:00

 

# go to work dir

cd $PBS_O_WORKDIR

 

 

echo $PBS_O_WORKDIR

 

# setup mpd env (Of course use some othersecret word than "dfadfs")

# Intel MPI Home

MPI_HOME=/opt/mpich214

 

# setup Nums of Processor

NP=`cat $PBS_NODEFILE|wc -l`

echo "Numbers of Processors:  $NP"

echo"---------------------------"

 

# Number of MPD

N_MPD=`cat $PBS_NODEFILE|uniq|wc -l`

echo "started mpd Number: $N_MPD"

echo"---------------------------"

 

# setup mpi env (em64t)

 

# running program

./run_scf

# clean

 

8) 異常情況處理

chmod –R 666 xxxx/

先[root@keylab2 vasp]# chmod a=rx ./vasp.5.2.mpich/vasp.5.2   

而後

[yexq@keylab2 vasp.5.2]$ ./vasp

 Error reading item 'IMAGES' from file INCAR.

 

chmod -vR 755 apps/

4、在node0x (x=1-9,計算結點上)

[root@node0x torque-2.3.0]#./torque-package-clients-linux-x86_64.sh --install

[root@node0x torque-2.3.0]#./torque-package-mom-linux-x86_64.sh --install

然後啓動pbs_mom ,把pbs_mom寫入/etc/rc.local

二、Torque PBS使用


1、創建用戶在master的root下

 

useradd test

passwd test

輸入test密碼

到/var/yp下make一下

gmake[1]:Entering directory `/var/yp/(none)'

Updating passwd.byname...

failed to send 'clear' to local ypserv:RPC: Program not registeredUpdating passwd.byuid...

failed to send 'clear' to local ypserv:RPC: Program not registeredUpdating group.byname...

failed to send 'clear' to local ypserv:RPC: Program not registeredUpdating group.bygid...

failed to send 'clear' to local ypserv:RPC: Program not registeredUpdating hosts.byname...

failed to send 'clear' to local ypserv:RPC: Program not registeredUpdating hosts.byaddr...

failed to send 'clear' to local ypserv:RPC: Program not registeredUpdating rpc.byname...

failed to send 'clear' to local ypserv:RPC: Program not registeredUpdating rpc.bynumber...

failed to send 'clear' to local ypserv:RPC: Program not registeredUpdating services.byname...

failed to send 'clear' to local ypserv:RPC: Program not registeredUpdating services.byservicename...

failed to send 'clear' to local ypserv:RPC: Program not registeredUpdating netid.byname...

failed to send 'clear' to local ypserv:RPC: Program not registeredUpdating protocols.bynumber...

failed to send 'clear' to local ypserv:RPC: Program not registeredUpdating protocols.byname...

failed to send 'clear' to local ypserv:RPC: Program not registeredUpdating netgroup...

failed to send 'clear' to local ypserv:RPC: Program not registeredUpdating netgroup.byhost...

failed to send 'clear' to local ypserv:RPC: Program not registeredUpdating netgroup.byuser...

failed to send 'clear' to local ypserv:RPC: Program not registeredUpdating mail.aliases...

failed to send 'clear' to local ypserv:RPC: Program not registeredUpdating shadow.byname... Ignored -> merged withpasswd

gmake[1]:*** No rule to make target `/etc/publickey', needed by `publickey.byname'.  Stop.

gmake[1]:Leaving directory `/var/yp/(none)'

make: *** [target]Error 2

2、配置普通用戶的ssh

su test

ssh-keygen -t dsa

cd .ssh

cat id_pub.dsa >> authorized_keys

chmod 600 authorized_keys

3、編寫作業腳本,見下文

4、啓動mpd

mpdboot -n 10 -f mfa

mfa內容:

master:4

node01:4

….

node09:4

5、提交,查詢,刪除作業

提交作業:qsub pbsjob

[test1@master pbstest]$ qsub pbsjob

48.master                                  作業提交後會有一個作業號

查詢作業:qstat

[test1@master pbstest]$ qstat

 

刪除作業:qdel 作業號

[test1@master pbstest]$ qdel 48

 

6 PBS服務開啓操作流程


       我
在Dawing上操作成功了!!

       1) 在主節點上打開PBS服務

             /etc/init.d/pbs_server start

       2) 在主節點和其他節點打開PBS客戶端。主節點雖是服務端,但也可參加計算,因而要打開客服。依次執行如下:

             /etc/init.d/pbs_mom   start

       3) 在所有節點上打開調度器

             /etc/init.d/maui.d     start  【?】

對於這些PBS的功能開啓有幾個相同的參量:

             status             查看狀態

             restart            重啓

             stop              終止

             start              開啓

       4) 接下來是檢查是否可以提交作業

             pbsnodes –a

返回free即表示可以提交作業。

       5) 寫腳本vim pbs_ fdtd_TE_xyPML_MPI_OpenMP

#!/bin/bash

#PBS -lnodes=5:ppn=4                     規定使用的節點數nodes以及每個節點能跑多少核ppn

#PBS –Ntaskname                         任取一作業任務名taskname

cd$PBS_O_WORKDIR                    到工作目錄下(此爲PBS提供的環境變量)

mpirun -np 20 ./fdtd_TE_xyPML_MPI_OpenMP

執行mpirun一句可以用-machinefile或-p4pg 命令參量制定

       6) 提交

             qsub pbs_ fdtd_TE_xyPML_MPI_OpenMP

       7) 可用qstat查看作業任務,具體參量參看下文。流程終結!

 

三、PBS常用命令和選項


!!3.1 基本腳本寫法和選項

事例:

川大vasp.pb s

!/bin/sh

#PBS -N DiGGA

#PBS -l nodes=node42

#PBS -q fast

cd /home/iamp/work/vasp/DiGGA

 

/public/software/mpi/openmpi1.4.2-intel/bin/mpirun--mca btl tcp,self -np 24 -hostfile $PBS_NODEFILE  /home/iamp/software/vas

p.4.6/vasp

 


PBS是Protable Batch System的縮寫,是一個任務管理系統。當多個用戶使用同一個計算資源時,每個用戶用PBS腳本提交自己的任務,由PBS對這些任務進行管理和資源的分配。下面是一個簡單的PBS腳本:

#!/bin/bash

#PBS -l nodes=20

#PBS -N snaphu

#PBS -j oe

#PBS -l walltime=24:00:00

#PBS -l cput=1:00:00

#PBS -q dque

cd $PBS_O_WORKDIR

cat $PBS_NODEFILE $PBS_NODEFILE>NODEFILE

mpirun -np ./mpitest

將這個腳本保存成submit然後qsub submit就將這個mpitest的任務提交給了系統。腳本中#PBS爲腳本選項,用於設置一些參數。

#PBS -l表示資源列表,用於設定特定任務所需的一些參數。這裏的nodes表示並行環境下可以使用的節點數,而walltime表示任務最大時限,而cput表示cpu時間的最大時限,運行時間和cpu使用時間超過對應的時限,任務就會以超時退出。這三個參數不是PBS腳本參數,而是並行環境所需的參數。

#PBS -N表示任務名稱。

#PBS -j表示系統輸出,如果是oe,則標準錯誤輸出(stderr)和標準輸出(stdout)合併爲stdout,如果是eo,則合併爲stderr,如果沒有設定或設定爲n,則stderr和stdout分開。

#PBS -q表示當前任務選用的隊列。在並行環境下,一個系統中往往有多個隊列,任務提交後,將在所選的隊列中排除等候。系統中有哪些隊列可以用qstat -q查看。

      PBS腳本文件由腳本選項和運行腳本兩部分組成。

     1)   PBS作業腳本選項(若無-C選項,則每項前面加‘#PBS’)


      2)   運行腳本同LINUX下一般的運行腳本文件格式如下:

        mpirun –np 進程數 ./可執行程序名

 

3.2 PBS命令與選項


PBS提供的4條命令用於作業管理

1. qsub 命令:用於提交作業腳本

命令格式:

qsub      [-a date_time]  

[-e path] [-I]   [-lresource_list]     

[-M user_list] [-N name]

[-S path_list]   [-uuser_list]  

[-Wadditional_attributes]      

例:# qsubaaa.pbs         提交某作業,系統將產生一個作業號

2. qstat 命令:用於查詢作業狀態信息

命令格式:

qstat [-f][-a][-i] [-n][-s] [-R][-Q][-q][-B][-u]

參數說明:

-f                  jobid 列出指定作業的信息

-a                 列出系統所有作業

-i                  列出不在運行的作業

-n                 列出分配給此作業的結點

-s                 列出隊列管理員與scheduler所提供的建議

-R                 列出磁盤預留信息

-Q                操作符是destination id,指明請求的是隊列狀態     

-q                列出隊列狀態,並以alternative形式顯示

-au userid      列出指定用戶的所有作業

-B                列出PBS Server信息

-r                 列出所有正在運行的作業

-Qf queue      列出指定隊列的信息

-u                若操作符爲作業號,則列出其狀態。

若操作符爲destination id,則列出運行在其上的屬於user_list中用戶的作業狀態。

例:# qstat -f 211      查詢作業號爲211的作業的具體信息。

3. qdel 命令:用於刪除已提交的作業

命令格式:

qdel [-W 間隔時間] 作業號

例:# qdel -W 15211            15秒後刪除作業號爲211的作業

4. qmgr 命令:用於隊列管理

      qmgr -c"create queue batch queue_type=execution"

      qmgr -c"set queue batch started=true"

      qmgr -c"set queue batch enabled=true"

      qmgr -c"set queue batch resources_default.nodes=1"

      qmgr -c"set queue batch resources_default.walltime=3600"

      qmgr -c"set server default_queue=batch"


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章