本文整理汇总了Python中pandatools.Client.submitJobs方法的典型用法代码示例。如果您正苦于以下问题:Python Client.submitJobs方法的具体用法?Python Client.submitJobs怎么用?Python Client.submitJobs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pandatools.Client
的用法示例。
在下文中一共展示了Client.submitJobs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: retry
# 需要导入模块: from pandatools import Client [as 别名]
# 或者: from pandatools.Client import submitJobs [as 别名]
#.........这里部分代码省略.........
newOpts['provenanceID'] = retryJobs[0].jobExecutionID
newOpts['panda_parentJobsetID'] = retryJobs[0].sourceSite
tmpLog.info("Constructing job spec again to be sent to another site ...")
comStat= PsubUtils.execWithModifiedParams(retryJobs,newOpts,self.verbose,newSite)
if comStat == 0:
# update database
time.sleep(2)
self.sync()
else:
tmpLog.error("Failed to submit jobs to Panda server")
return
# register datasets
tmpOutDsLocation = Client.PandaSites[retryJobs[-1].computingSite]['ddm']
addedDataset = []
shadowDSname = None
for tmpFile in retryJobs[-1].Files:
if tmpFile.type in ['output','log'] and tmpFile.dataset.endswith('/'):
# add shadow
"""
removed shadow
if shadowDSname == None and tmpFile.type == 'log':
shadowDSname = "%s%s" % (tmpFile.destinationDBlock,Client.suffixShadow)
Client.addDataset(shadowDSname,self.verbose)
"""
# add datasets
if not tmpFile.destinationDBlock in addedDataset:
# create dataset
Client.addDataset(
tmpFile.destinationDBlock,
self.verbose,
location=tmpOutDsLocation,
dsCheck=False)
# add to container
Client.addDatasetsToContainer(
tmpFile.dataset,
[tmpFile.destinationDBlock],
self.verbose)
# append
addedDataset.append(tmpFile.destinationDBlock)
# register libDS
if retryBuild and newLibDS != None:
Client.addDataset(
newLibDS,
self.verbose,
location=tmpOutDsLocation,
dsCheck=False)
# submit
tmpLog.info("Submitting job ...")
status,out = Client.submitJobs(retryJobs,verbose=self.verbose)
if out == None or status != 0:
tmpLog.error(status)
tmpLog.error(out)
tmpLog.error("Failed to submit jobs to Panda server")
return
# update database
pandaIDstatus = {}
newJobID = None
for items in out:
# get newJobID
if newJobID == None:
newJobID = items[1]
# check PandaID
PandaID = items[0]
if PandaID == 'NULL':
tmpLog.error("Panda server returned wrong IDs. It may have a temporary problem")
return
# set newJobsetID
if newJobsetID in [None,-1]:
newJobsetID = items[2]['jobsetID']
# dummy statuso
pandaIDstatus[PandaID] = ('defined','NULL')
# set retry ID
if not unsetRetryID:
localJob.retryID = newJobID
if not newJobsetID in [None,-1,'NULL']:
localJob.retryJobsetID = newJobsetID
try:
PdbUtils.updateJobDB(localJob,self.verbose)
except:
tmpLog.error("Failed to set retryID for JobID=%s" % JobID)
return
# set new paramers
newLocalJob = PdbUtils.convertPtoD(retryJobs,pandaIDstatus)
newLocalJob.JobID = newJobID
if not newJobsetID in [None,-1,'NULL']:
newLocalJob.groupID = newJobsetID
newLocalJob.creationTime = datetime.datetime.utcnow()
# insert to DB
try:
PdbUtils.insertJobDB(newLocalJob,self.verbose)
except:
tmpLog.error("Failed to insert JobID=%s to local repository" % newJobID)
return
# write new jobdefID
PsubUtils.writeJobDefID(newJobID)
# done
tmpMsg = 'Done. New JobID=%s' % newJobID
if not newJobsetID in [None,-1,'NULL']:
tmpMsg += " JobsetID=%s" % newJobsetID
tmpLog.info(tmpMsg)