| 1 | 1/1 | 返回列表 |
| 查看: 491 | 回復(fù): 0 | ||
wuy069鐵桿木蟲(chóng) (正式寫(xiě)手)
|
[求助]
請(qǐng)教:用Shell, awk, perl等語(yǔ)言實(shí)現(xiàn)監(jiān)視SGE集群節(jié)點(diǎn)和任務(wù)
|
|
http://www.gaoyang168.com/bbs/viewthread.php?tid=5282178&fpage=1 (有100金幣在這個(gè)帖子中) 請(qǐng)教:用Shell, awk, perl等語(yǔ)言實(shí)現(xiàn)監(jiān)視SGE集群節(jié)點(diǎn)和任務(wù) 簡(jiǎn)單的bash shell和awk語(yǔ)言會(huì)點(diǎn),但弄個(gè)復(fù)雜的腳本,功底還是不夠 [wuy@cluster test]$ qhost -j HOSTNAME ARCH NCPU LOAD MEMTOT MEMUSE SWAPTO SWAPUS ------------------------------------------------------------------------------- global - - - - - - - compute-0-0 lx26-amd64 4 2.97 3.9G 3.5G 4.0G 2.9G job-ID prior name user state submit/start at queue master ja-task-ID ---------------------------------------------------------------------------------------------- 6 0.50500 test1.sh wuy r 12/09/2012 14:47:26 all.q@comp MASTER 7 0.60500 test4.sh wuy r 12/09/2012 14:47:26 all.q@comp MASTER all.q@comp SLAVE all.q@comp SLAVE compute-0-1 lx26-amd64 4 3.56 3.9G 3.8G 4.0G 3.1G job-ID prior name user state submit/start at queue master ja-task-ID ---------------------------------------------------------------------------------------------- 8 0.60500 test2.sh tester r 12/09/2012 14:48:52 all.q@comp MASTER all.q@comp SLAVE all.q@comp SLAVE 9 0.60500 test3.sh tester r 12/09/2012 14:48:52 all.q@comp MASTER all.q@comp SLAVE all.q@comp SLAVE 在compute-0-0節(jié)點(diǎn)上有兩個(gè)任務(wù)6和7,所用的cpu分別為1和2;在compute-0-1節(jié)點(diǎn)上有兩個(gè)任務(wù)8和9,所用的cpu分別為2和2. 使用Shell, awk, perl等語(yǔ)言獲得的命令腳本打印輸出下面所示: ------------------------------------------------------------------------------------------------ node state load ncpu mem memuse swapto swapus tasks jobids/users ------------------------------------------------------------------------------------------------ compute-0-0 free 2.97 4 3.9G 3.5G 4.0G 2.9G 3 6/wuy 7/wuy compute-0-1 busy 3.56 4 3.9G 3.8G 4.0G 3.1G 4 8/tester 9/tester 其中,當(dāng)node的LOAD為“-”時(shí),相應(yīng)node的state為down. 下面是根據(jù)qstat命令編寫(xiě)腳本監(jiān)視任務(wù)的申請(qǐng)時(shí)間和逝去時(shí)間 [wuy@cluster test]$ qstat -u '*' job-ID prior name user state submit/start at queue slots ja-task-ID ----------------------------------------------------------------------------------------------------------------- 6 0.50500 test1.sh wuy r 12/09/2012 14:47:26 all.q@compute-0-0.local 1 7 0.60500 test4.sh wuy r 12/09/2012 14:47:26 all.q@compute-0-0.local 2 8 0.60500 test2.sh tester r 12/09/2012 14:48:52 all.q@compute-0-1.local 2 9 0.60500 test3.sh tester r 12/09/2012 14:48:52 all.q@compute-0-1.local 2 [wuy@cluster test]$ qstat -j 6 |grep h_rt hard resource_list: h_rt=3600 得到的申請(qǐng)時(shí)間(reqtime)為3600s,改為小時(shí)制:1:00:00 逝去的時(shí)間(elaptime)為現(xiàn)在的時(shí)間`date`減去任務(wù)開(kāi)始的時(shí)間 使用Shell, awk, perl等語(yǔ)言獲得的命令腳本打印輸出下面所示 job-ID name user state submit/start at queue slots reqtime elaptime -------------------------------------------------------------------------------------------------------------------- 6 test1.sh wuy r 12/09/2012 14:47:26 all.q@compute-0-0.local 1 1:00:00 00:50:00 7 test4.sh wuy r 12/09/2012 14:47:26 all.q@compute-0-0.local 2 2:00:00 00:50:00 8 test2.sh tester r 12/09/2012 14:48:52 all.q@compute-0-1.local 2 5:00:00 00:48:34 9 test3.sh tester r 12/09/2012 14:48:52 all.q@compute-0-1.local 2 12:00:00 00:48:34 |
| 1 | 1/1 | 返回列表 |
|
[考研] 工科材料085601 279求調(diào)劑 +6 | 困于星晨 2026-03-17 | 8/400 |
|
|---|---|---|---|---|
|
[考研] 材料080500調(diào)劑求收留 +6 | 一顆meteor 2026-03-13 | 6/300 |
|
|
[考研] 298-一志愿中國(guó)農(nóng)業(yè)大學(xué)-求調(diào)劑 +8 | 手機(jī)用戶(hù) 2026-03-17 | 8/400 |
|
|
[考研] 265求調(diào)劑 +8 | 梁梁校校 2026-03-19 | 8/400 |
|
|
[考研] 265求調(diào)劑 +6 | 梁梁校校 2026-03-17 | 6/300 |
|
|
[考研]
|
不想起名字112 2026-03-19 | 3/150 |
|
|
[考研] 294求調(diào)劑材料與化工專(zhuān)碩 +14 | 陌の森林 2026-03-18 | 14/700 |
|
|
[考研] 材料與化工求調(diào)劑 +7 | 為學(xué)666 2026-03-16 | 7/350 |
|
|
[考研] 085600材料與化工調(diào)劑 324分 +10 | llllkkkhh 2026-03-18 | 12/600 |
|
|
[考研] 324分 085600材料化工求調(diào)劑 +3 | llllkkkhh 2026-03-18 | 3/150 |
|
|
[考研] 0703化學(xué)調(diào)劑,求各位老師收留 +10 | 秋有木北 2026-03-14 | 10/500 |
|
|
[考研] 085601專(zhuān)碩,總分342求調(diào)劑,地區(qū)不限 +5 | share_joy 2026-03-16 | 5/250 |
|
|
[考研] 0703化學(xué)求調(diào)劑 總分331 +3 | ZY-05 2026-03-13 | 3/150 |
|
|
[考博] 26博士申請(qǐng) +3 | 1042136743 2026-03-17 | 3/150 |
|
|
[考研] 290求調(diào)劑 +3 | p asserby. 2026-03-15 | 4/200 |
|
|
[考研] 283求調(diào)劑 +3 | 聽(tīng)風(fēng)就是雨; 2026-03-16 | 3/150 |
|
|
[考研] 機(jī)械專(zhuān)碩325,尋找調(diào)劑院校 +3 | y9999 2026-03-15 | 5/250 |
|
|
[考研] 326求調(diào)劑 +3 | mlpqaz03 2026-03-15 | 3/150 |
|
|
[考研] 080500,材料學(xué)碩302分求調(diào)劑學(xué)校 +4 | 初識(shí)可樂(lè) 2026-03-14 | 5/250 |
|
|
[考研] 330求調(diào)劑 +3 | ?醬給調(diào)劑跪了 2026-03-13 | 3/150 |
|