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


Python Dirac.getJobSummary方法代码示例

本文整理汇总了Python中DIRAC.Interfaces.API.Dirac.Dirac.getJobSummary方法的典型用法代码示例。如果您正苦于以下问题:Python Dirac.getJobSummary方法的具体用法?Python Dirac.getJobSummary怎么用?Python Dirac.getJobSummary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DIRAC.Interfaces.API.Dirac.Dirac的用法示例。


在下文中一共展示了Dirac.getJobSummary方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: len

# 需要导入模块: from DIRAC.Interfaces.API.Dirac import Dirac [as 别名]
# 或者: from DIRAC.Interfaces.API.Dirac.Dirac import getJobSummary [as 别名]
if len(sys.argv)< 2 :
  print "Usage %s <jobName>"%sys.argv[0]
  sys.exit(1)

jobName = sys.argv[1]

finalStatus = ['Done', 'Failed']

dirac = Dirac()

idstr = open("%s/jobIdList.txt"%jobName, 'r').readlines()
ids = map(int, idstr)
print "found %s jobs"%(len(ids))

res = dirac.getJobSummary(ids)
if not res['OK']:
  print res['Message']
  sys.exit(1)

metadata = res['Value']

for jid in ids:
  jobMeta = metadata.get( jid, None )
  if not jobMeta :
    print "No metadata for job ", jid
    continue

  status = jobMeta['Status']
  print "%s %s" % ( jid, status )
  if status  in finalStatus:
开发者ID:DIRACGrid-test,项目名称:DIRAC,代码行数:32,代码来源:retrieveResult.py

示例2: Dirac

# 需要导入模块: from DIRAC.Interfaces.API.Dirac import Dirac [as 别名]
# 或者: from DIRAC.Interfaces.API.Dirac.Dirac import getJobSummary [as 别名]
#!/bin/env python

import sys

from DIRAC.Core.Base import Script
Script.parseCommandLine()

from DIRAC.Interfaces.API.Job import Job
from DIRAC.Interfaces.API.Dirac import Dirac

dirac = Dirac()
jobid = sys.argv[1]

print dirac.status(jobid)

summary_file = str(jobid) + "_summary.txt"
dirac.getJobSummary(jobid, outputFile=summary_file, printOutput=True)

print dirac.getJobDebugOutput(jobid)

print dirac.getJobLoggingInfo(jobid, printOutput=False)

开发者ID:adriansev,项目名称:auger-dirac,代码行数:23,代码来源:dirac.job_status.py

示例3: dexit

# 需要导入模块: from DIRAC.Interfaces.API.Dirac import Dirac [as 别名]
# 或者: from DIRAC.Interfaces.API.Dirac.Dirac import getJobSummary [as 别名]
        if "dayspassed" in specialOptions:
            timedelta = local_time-datetime.timedelta(seconds=float(specialOptions["dayspassed"])*3600)
        res = w.getJobs(my_dict,timedelta.strftime( '%Y-%m-%d %H:%M:%S' ))

        if not res['OK']:
            gLogger.error("Could not get list of running jobs.",res['Message'])
            dexit(1)
        job_list = res['Value']
    else:
        job_list = specialOptions["JobID"].split(",")
        doLogging = True
    status = {}
    sites = {} 

    for chunk in breakListIntoChunks(job_list,1000):
        res = d.getJobSummary(chunk)   
        if not res['OK']:
            gLogger.error("Could not get status of job list chunk,",res['Message'])
            if do_xml:
                d.exit(1)            
            continue
        status.update(res['Value'])
    # get sites info
        res = w.getJobsSites(chunk)
        if not res['OK']:
            gLogger.error("Could not get sites;",res['Message'])
        sites.update(res['Value'])
    
    if not do_xml:
        print('# ID\thostname\tStatus\tSubmitted\tStarted\tEnded\tCPUtime\tMemory')
开发者ID:Glast,项目名称:GlastDIRAC,代码行数:32,代码来源:dirac-glast-pipeline-status.py


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