当前位置: 首页>>代码示例>>Python>>正文


Python Scheduler.doCommand方法代码示例

本文整理汇总了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 = {}
开发者ID:atombaby,项目名称:python-moab,代码行数:33,代码来源:usage.py

示例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
开发者ID:atombaby,项目名称:python-moab,代码行数:33,代码来源:inuse.py


注:本文中的scheduler.Scheduler.doCommand方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。