本文整理汇总了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:
示例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)
示例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')