| 查看: 455 | 回复: 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 |
» 猜你喜欢
求2026年在台湾举行的物理和材料领域国际学术会议信息
已经有0人回复
求国际会议网站
已经有1人回复
物理学I论文润色/翻译怎么收费?
已经有120人回复
求取一些关于纳米材料和纳米技术相关的英文PPT。
已经有0人回复
【复旦大学】二维材料方向招收2026年博士研究生1名
已经有0人回复
北京纳米能源与系统研究所 王中林院士/曹南颖研究员课题组2026级硕/博/博后招生
已经有10人回复
荷兰Utrecht University超快太赫兹光谱王海教授课题招收2026 CSC博士生
已经有19人回复
反铁磁体中的磁性切换:两种不同的机制已成功可视化
已经有0人回复
26申博推荐:南京航空航天大学国际前沿院光学方向招收博士生!
已经有0人回复
求标准粉末衍射卡号 ICDD 01-076-1802
已经有0人回复













回复此楼