本文整理汇总了Python中scheduler.Scheduler.doCommand方法的典型用法代码示例。如果您正苦于以下问题:Python Scheduler.doCommand方法的具体用法?Python Scheduler.doCommand怎么用?Python Scheduler.doCommand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scheduler.Scheduler
的用法示例。
在下文中一共展示了Scheduler.doCommand方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: userSummary
# 需要导入模块: from scheduler import Scheduler [as 别名]
# 或者: from scheduler.Scheduler import doCommand [as 别名]
pvc = pvc + self.users[ user ]['private'][1]
pbn = pbn + self.users[ user ]['public'][0]
pbc = pbc + self.users[ user ]['public'][1]
return [ pvn, pvc, pbn, pbc ]
def userSummary( self, user ):
return[
self.users[ user ]['private'][0],
self.users[ user ]['private'][1],
self.users[ user ]['public'][0],
self.users[ user ]['public'][1],
]
r = et.fromstring(
s.doCommand( [ "mdiag", "--xml", '-r', ] )
)
reserved_nodes = {}
for q in r.findall( 'rsv' ):
rsv = Reservation( q.attrib )
if 'STANDINGRSV' in rsv.flags:
reserved_nodes.update( rsv.AllocNodeList )
r = et.fromstring(
s.doCommand( [ "mdiag", "--xml", '-j', ] )
)
# total = {'acctname':AS()}}
total = {}
示例2: Scheduler
# 需要导入模块: from scheduler import Scheduler [as 别名]
# 或者: from scheduler.Scheduler import doCommand [as 别名]
# ckang2 16
# syin2 2
# krcurtis 1
# Free 62
# Total 1496
from scheduler import Scheduler
from mtypes import Job
import xml.etree.ElementTree as et
s = Scheduler()
summary = {}
r = et.fromstring(
s.doCommand( [ "showq", "--xml", '-r', ] )
)
# Used/free stats are in the "cluster" branch
free_nodes = r.find( 'cluster' ).attrib[ 'LocalIdleNodes' ]
up_nodes = r.find( 'cluster' ).attrib[ 'LocalUpNodes' ]
free_cores = r.find( 'cluster' ).attrib[ 'LocalIdleProcs' ]
up_cores = r.find( 'cluster' ).attrib[ 'LocalUpProcs' ]
for j in r.findall( 'queue/job' ):
job = Job( j.attrib )
try:
summary[ job.User ] = summary[ job.User ] + job.ReqProcs
except KeyError:
summary[ job.User ] = job.ReqProcs