LSF系統介紹

Augusdi發表於2015-05-08


LSF系統介紹


http://scc.ustc.edu.cn/zh_CN/ 中科大超算中心
http://www.sccas.cn/gb/index.html 中科院超算中心
http://www.ssc.net.cn/ 上漲超算中心

LSF簡介
LSF(Load Sharing Facility)是分佈資源管理的工具,用來排程、監視、分析聯網計算機的負載。
目的
通過集中監控和排程,充分共享計算機的CPU、記憶體、磁碟、License等資源
一組安裝了LSF軟體的計算機組成一個Cluster
Cluster內的資源統一監控和排程
LSF Cluster的組成
LSF 術語
Cluster
一組執行LSF軟體的計算機(當然是用TCP/IP網路互連的),跟計算Cluster術語無關
命令
bhosts 列出cluster中的機器
lsid 顯示cluster名字
lsclusters 顯示cluster狀態和規模
LSF 術語
Server Host
Cluster內提交和執行Job的計算機
Client Host
Cluster內僅僅提交Job的計算機
在科大的Cluster中,node1-node32是ServerHost
LSF 術語
Job
提交給LSF 的命令
LSF負責排程、控制、跟蹤job
命令
bjobs 檢視系統的Job
bsub 提交作業
bhist 檢視作業歷史
bkill kill一個作業



使用Platform LSF


LSF使用綜述
故障分析
作業提交與管理
資源管理
系統監視

LSF使用綜述
設定LSF 環境變數
% login as: test
Using keyboard-interactive authentication.
Password:
Last login: Mon Dec 21 09:31:29 2009 from 11.11.11.241

test@node69:~> env | grep LSF
LSF_SERVERDIR=/public/software/lsf/7.0/linux2.6-glibc2.3-x86_64/etc
LSF_LIBDIR=/public/software/lsf/7.0/linux2.6-glibc2.3-x86_64/lib
LSF_VERSION=7.0
LSF_BINDIR=/public/software/lsf/7.0/linux2.6-glibc2.3-x86_64/bin
XLSF_UIDDIR=/public/software/lsf/7.0/linux2.6-glibc2.3-x86_64/lib/uid
LSF_ENVDIR=/public/software/lsf/conf


作業提交:普通並行作業(要求程式為並行才能並行提交)
作業提交:Gauss作業
test@node69:~/gauss-test> bsub -W 60 -n 32 -q QN_Norm g03.lsf test397.com
Job <716> is submitted to queue <QN_Norm>.
引數說明: g03.lsf, Gauss執行關鍵字
-W 60 作業最長執行60分鐘
- n 32 需要32個CPU
-q QN_Norm 指定QN_Norm佇列
隱藏引數:output.%J, 標準輸出檔案(包括相關錯誤提示)

作業提交:Dock作業
test@node69:~/dock6-test> bsub –W 12:00 -a openmpi -n 4 mpirun.lsf /public/software/dock6-openmpi/bin/dock6.mpi -i test.in -o test.out
Job <818> is submitted to default queue <QS_Norm>.
引數說明: -a openmpi 指定用openmpi運算
-W 12:00 執行12小時
- n 4 需要32個CPU
-mpirun.lsf, 使用openmpi時的關鍵字
無-q 引數 指定QS_Norm佇列
隱藏引數:output.%J, 標準輸出檔案(包括相關錯誤提示)


作業提交:blast作業
test@node69:~/mpiblast-test> bsub -W 360 -n 32 -q QN_Norm -a openmpi mpirun.lsf ./blast.sh
Job <819> is submitted to queue <QN_Norm>.

引數說明: -a openmpi 指定用openmpi運算
-W 360 執行360分鐘
- n 32 需要32個CPU
-mpirun.lsf, 使用openmpi時的關鍵字
-q QN_Norm 指定QN_Norm佇列
隱藏引數:output.%J, 標準輸出檔案(包括相關錯誤提示)


作業提交:普通序列作業
test@node69:~> bsub –W 60 a.out ./bowtie-build.sh 引數
Job <820> is submitted to default queue <QS_Norm>.
引數說明: -W 60 執行60分鐘
無 - n 引數 使用1個CPU
無-q 引數 指定QS_Norm佇列
隱藏引數:output.%J, 標準輸出檔案(包括相關錯誤提示)


作業提交:普通使用openmpi的MPI作業
與DOCK和blastmpi 相同:
test@node69:~/mpiblast-test> bsub -W 360 -n 32 -q QN_Norm -a openmpi mpirun.lsf ./blast.sh
Job <819> is submitted to queue <QN_Norm>.
引數說明: -a openmpi 指定用openmpi運算
-W 360 執行360分鐘
- n 32 需要32個CPU
-mpirun.lsf, 使用openmpi時的關鍵字
-q QN_Norm 指定QN_Norm佇列
隱藏引數:output.%J, 標準輸出檔案(包括相關錯誤提示)


作業提交:普通使用openmpi的MPI作業
與DOCK和blastmpi 相同:
test@node69:~/mpiblast-test> bsub -W 360 -n 32 -q QN_Norm -a openmpi mpirun.lsf ./blast.sh
Job <819> is submitted to queue <QN_Norm>.
引數說明: -a openmpi 指定用openmpi運算
-W 360 執行360分鐘
- n 32 需要32個CPU
-mpirun.lsf, 使用openmpi時的關鍵字
-q QN_Norm 指定QN_Norm佇列
隱藏引數:output.%J, 標準輸出檔案(包括相關錯誤提示)

作業提交:普通使用openmpi的MPI作業
與DOCK和blastmpi 相同:
test@node69:~/mpiblast-test> bsub -W 360 -n 32 -q QN_Norm -a openmpi mpirun.lsf ./blast.sh
Job <819> is submitted to queue <QN_Norm>.
引數說明: -a openmpi 指定用openmpi運算
-W 360 執行360分鐘
- n 32 需要32個CPU
-mpirun.lsf, 使用openmpi時的關鍵字
-q QN_Norm 指定QN_Norm佇列
隱藏引數:output.%J, 標準輸出檔案(包括相關錯誤提示)

作業提交:互動式圖形作業和作業陣列
test@node69:~/mpiblast-test> bsub –Ip xclock
Job <819> is submitted to queue <QS_Norm>.

引數說明: -Ip 需要偽終端的互動方式圖形支援
作業陣列:
> Bsub –J Jobname[1-100] –i input.%I –o outpout.%I Exec.out

作業線上監視

test@node69:~> bjobs -w
JOBID USER STAT QUEUE FROM_HOST EXEC_HOST JOB_NAME SUBMIT_TIME
test RUN QS_Norm node69 4*node10 mpirun.lsf /public/software/dock6-openmpi/bin/dock6.mpi -i test.in -o test.out Dec 21 19:29

test@node69:~> bjobs -l 818

Job <818>, User <test>, Project <default>, Status <RUN>, Queue <QS_Norm>, Comma
nd <mpirun.lsf /public/software/dock6-openmpi/bin/dock6.mp
i -i test.in -o test.out>, Share group charged </test>
Mon Dec 21 19:29:35: Submitted from host <node69>, CWD <$HOME/dock6-test>, Outp
ut File </home/test/dock6-test/output.%J>, 4 Processors Re
quested;
Mon Dec 21 19:29:39: Started on 4 Hosts/Processors <4*node10>, Execution Home <
/home/test>, Execution CWD </home/test/dock6-test>;
Mon Dec 21 19:47:18: Resource usage collected.
The CPU time used is 4174 seconds.
MEM: 96 Mbytes; SWAP: 703 Mbytes; NTHREAD: 23
PGID: 28118; PIDs: 28131 28133 28137 28138 28139 28118
28140 28141 28129
PGID: 28143; PIDs: 28143
PGID: 28142; PIDs: 28142
PGID: 28144; PIDs: 28144
PGID: 28145; PIDs: 28145
SCHEDULING PARAMETERS:
r15s r1m r15m ut pg io ls it tmp swp mem
loadSched - - - - - - - - - - -
loadStop - - - - - - - - - - -

作業線上監視

test@node69:~> bjobs -aw
JOBID USER STAT QUEUE FROM_HOST EXEC_HOST JOB_NAME SUBMIT_TIME
818 test RUN QS_Norm node69 4*node10 mpirun.lsf /public/software/dock6-openmpi/bin/dock6.mpi -i test.in -o test.out Dec 21 19:29
115 test DONE lost_and_found node70 node1 sleep 1000 Dec 19 16:31
116 test DONE lost_and_found node70 node62 sleep 100 Dec 19 17:07
117 test DONE lost_and_found node70 node62 sleep 100 Dec 19 17:07
119 test DONE lost_and_found node70 node61 sleep 100 Dec 19 17:07
118 test DONE lost_and_found node70 node69 sleep 100 Dec 19 17:07
120 test DONE lost_and_found node70 node70 sleep 100 Dec 19 17:07
-

作業線上監視
檢查作業歷史狀態

test@node69:~> bhist -aw
Summary of time in seconds spent in various states:
JOBID USER JOB_NAME PEND PSUSP RUN USUSP SSUSP UNKWN TOTAL
223 test mpirun.lsf ./cpi-openmpi 6 0 5 0 0 0 11
224 test mpirun.lsf ./cpi-openmpi 5 0 5 0 0 0 10
225 test mpirun.lsf openmpi 3 0 4 0 0 0 7
226 test mpirun.lsf ./cpi-openmpi 5 0 7 0 0 0 12
227 test mpirun.lsf ./cpi-mpich 2 0 0 0 0 0 2
228 test mpirun.lsf ./cpi-mpich 4 0 1994 0 0 0 1998
229 test mpirun.lsf ./cpi-openmpi 6 0 7 0 0 0 13
作業線上監視
檢查作業歷史狀態

test@node69:~> bhist -l 223

Job <223>, User <test>, Project <default>, Command <mpirun.lsf ./cpi-openmpi>
Sun Dec 20 15:05:40: Submitted from host <node69>, to Queue <default>, CWD <$HO
ME>, Output File </home/test/output.%J>, 16 Processors Req
uested;
Sun Dec 20 15:05:46: Dispatched to 16 Hosts/Processors <16*node62>;
Sun Dec 20 15:05:46: Starting (Pid 30493);
Sun Dec 20 15:05:46: Running with execution home </home/test>, Execution CWD </
home/test>, Execution Pid <30493>;
Sun Dec 20 15:05:51: Done successfully. The CPU time used is 9.6 seconds;
Sun Dec 20 15:05:51: Post job process done successfully;

Summary of time in seconds spent in various states by Sun Dec 20 15:05:51
PEND PSUSP RUN USUSP SSUSP UNKWN TOTAL
6 0 5 0 0 0 11
作業線上監視
檢查作業歷史狀態

test@node69:~> bjobs
JOBID USER STAT QUEUE FROM_HOST EXEC_HOST JOB_NAME SUBMIT_TIME
818 test RUN QS_Norm node69 4*node10 * test.out Dec 21 19:29

test@node69:~> bpeek -f 818
<< output from stdout >>
Initializing MPI Routines...
Initializing MPI Routines...
Initializing MPI Routines...
Initializing MPI Routines...
殺掉:
test@node69:~> bkill 1480

作業管理
檢查作業歷史狀態

機器負載狀態


機器作業狀態


機器分組


佇列狀態


佇列狀態


故障分析
Job exit analysis

LSF Keep the job exit as it does
“bhist –l <jobid>” and “bjobs –l <jobid>” check the job exit code
Submit a job with “-o %J.out” and check the output file <jobid>.out
Typical User Problems (cont.d)
“My job dies under LSF”
Check resource limits on queues
Check that the application and its data files are accessible from the execution host(s)
Is an application license available from the execution host?
Check the exit code reported by bjobs –l
Common exit codes
127 – Command not found
128 – Command invoked cannot execute
130 – Scripts terminated by Control-C
Typical User Problems
“My job was rejected by LSF”
Check resource requirement string, run time limit
Submission to an unauthorized queue or host
Requested soft limits exceeding a queues hard limits
Typical User Problems (cont.d)
“My job PENDs forever under LSF”
Has the user requested unrealistic resources?
More memory than any host has
Resource requirements may be too stringent
Is the users id valid on the execution host(s)?
The user may have requested exclusive execution
If FCFS scheduling is used, the user may be last
If fairshare scheduling is used, the user may have exhausted their fairshare allocation
Use bjobs –lp to see the pending reason
When all else fails….


下表對常見的作業狀態解釋:
狀態 含義
作業正在佇列中排隊
PEND
作業正在被執行
RUN
作業已經執行完畢,並且正常退出
DONE
作業非正常退出
EXITED
作業在排隊過程中被掛起
PSUSP
作業在執行過程中被人為強制掛起
USUSP
作業在執行過程中被系統掛起
SSUSP


附 1:LSF 作業管理系統和原有 LJRS 作業管理系統命令對照表
LJRS LSF
提交作業 qsub bsub
提交名為 run.sh 的作業指令碼,使用
x 結點,每結點 y 個 CPU,總共需 qsub -l nodes=x:ppn=y -P default bsub -n z -R “span[ptile=y]” -q
要 z 個 CPU, 將作業提交到名稱為 run.sh default run.sh
default 的佇列(結點池)中
應 用 -o 參 數 指定輸 出信 息文
儲存在作業所提交目錄的
件,否 則將 在作業 執行 主結點
作業輸出資訊
xxx.o(jobid)下
以 mail 的形式儲存
檢視尚未完成的作業資訊 qstat(顯示全部使用者作業) bjobs(顯示當前使用者作業)
檢視所有使用者的作業資訊 qstat bjobs -u all
檢視指定使用者 user1 的作業資訊 qstat -u user1 bjobs -u user1
檢視作業的詳細資訊 qstat -f jobid bjobs -l jobid
檢視剛執行完畢的作業資訊 無 bjobs -a
bstop JOBID(可以掛起正在運
掛起作業 qhold JOBID
行的作業)
釋放作業 qrls JOBID bresume JOBID
移 動未運 行 的作業到 隊 列(結點
qmov queue JOBID bswitch queue JOBID
池)queue 當中
刪除一個作業 qdel jobid bkill jobid
檢視作業已產生的輸出資訊 無 bpeek jobid
檢視作業歷史 無 bhist jobid
作業歷史詳細資訊 無 bhist -l jobid

附 2、LSF 作業管理系統其他命令簡介
1、bsub –I –m 引數
bsub –I 引數用於提交互動式作業。
bsub –m 引數用於向指定結點提交作業,下列命令將作業提交到指定結點 c0305 和 c0807 上
例如:bsub –m "c0305 c0807" -n 8 mpijob_qs ./mytest bqueue
2、bqueues 命令
bqueues 命令用於檢視佇列資訊, 預設情況下, ueues 命令列出 LSF 系統中定義的全部佇列資訊,
bq
包括佇列名、優先順序、狀態資訊、最大可用資源數、排隊作業數、執行作業數等資訊。
“bqueues –l 佇列名” 命令可以列出指定佇列的詳細資訊,包括描述資訊、該佇列優先順序、最大運
行時間限制、作業規模限制、佇列所包含的結點、佇列所包含的使用者以及這些使用者的動態優先順序(提
交作業越多、規模也大,優先順序越低)等資訊。
3、brequeue
brequeue 命令用於作業重新排隊,使用者可以使用該命令終止指定的、隸屬於自己的、並正在執行
的作業,該作業將以原有的作業號重新進行排隊,重新獲得排程、執行。
4、btop/bbot
btop/bbot 命令用於改變處於“PEND”狀態的作業獲得排程的次序,使用者只能改變自己處於同一隊
列內的作業的相對次序, p 使指定作業在同一佇列內的, 所有同優先順序的作業中最先獲得排程。 ot
bto bb
則相反。
5、bhosts
bhosts 命令用於檢視結點狀態,處於“ok”狀態的結點表示該節點可以接收使用者作業。結點上已
經有作業執行或者負載過高都會導致“closed”狀態。

相關文章