| 查看: 473 | 回复: 0 | ||
wuy069铁杆木虫 (正式写手)
|
[求助]
请教:用Shell, awk, perl等语言实现监视SGE集群节点和任务
|
|
http://muchong.com/bbs/viewthread.php?tid=5282178&fpage=1 (有100金币在这个帖子中) 请教:用Shell, awk, perl等语言实现监视SGE集群节点和任务 简单的bash shell和awk语言会点,但弄个复杂的脚本,功底还是不够 [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节点上有两个任务6和7,所用的cpu分别为1和2;在compute-0-1节点上有两个任务8和9,所用的cpu分别为2和2. 使用Shell, awk, perl等语言获得的命令脚本打印输出下面所示: ------------------------------------------------------------------------------------------------ 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 其中,当node的LOAD为“-”时,相应node的state为down. 下面是根据qstat命令编写脚本监视任务的申请时间和逝去时间 [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 得到的申请时间(reqtime)为3600s,改为小时制:1:00:00 逝去的时间(elaptime)为现在的时间`date`减去任务开始的时间 使用Shell, awk, perl等语言获得的命令脚本打印输出下面所示 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 |
» 猜你喜欢
新西兰Robinson研究所招收全奖PhD
已经有0人回复
石墨烯转移--二氧化硅衬底石墨烯
已经有0人回复
物理学I论文润色/翻译怎么收费?
已经有297人回复
笼目材料中量子自旋液体基态的证据
已经有0人回复
数学教学论硕士可以读数学物理博士吗?
已经有0人回复
德国亥姆霍兹Hereon中心汉堡分部招镁合金腐蚀裂变SCC课题方向2026公派博士生
已经有4人回复
澳门大学 应用物理及材料工程研究院 潘晖教授课题组诚招博士后
已经有11人回复
求助NH4V4O10晶体的CIF文件
已经有0人回复
英国全奖博士招聘-深度学习与量子物理
已经有0人回复
间接带隙半导体有效质量求助
已经有1人回复
投稿chemical physical letters不送审?
已经有2人回复













回复此楼