本文整理匯總了Python中pandatools.Client.insertTaskParams方法的典型用法代碼示例。如果您正苦於以下問題:Python Client.insertTaskParams方法的具體用法?Python Client.insertTaskParams怎麽用?Python Client.insertTaskParams使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pandatools.Client
的用法示例。
在下文中一共展示了Client.insertTaskParams方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: master_submit
# 需要導入模塊: from pandatools import Client [as 別名]
# 或者: from pandatools.Client import insertTaskParams [as 別名]
def master_submit(self,rjobs,subjobspecs,buildjobspec):
'''Submit jobs'''
from pandatools import Client
from pandatools import MiscUtils
from Ganga.Core import IncompleteJobSubmissionError
from Ganga.Utility.logging import log_user_exception
job = self.getJobObject()
# job name
jobName = 'ganga.%s' % MiscUtils.wrappedUuidGen()
jobspecs = {}
if buildjobspec:
jobspecs = buildjobspec
else:
jobspecs = subjobspecs
logger.debug(jobspecs)
# submit task
for subjob in rjobs:
subjob.updateStatus('submitting')
logger.info("Submitting to Jedi ...")
verbose = logger.isEnabledFor(10)
with inject_proxy(self.credential_requirements):
status, tmpOut = Client.insertTaskParams(jobspecs, verbose)
logger.debug(tmpOut)
if status != 0:
logger.error("Task submission to Jedi failed with %s " %status)
return False
if tmpOut[0] == False:
logger.error("Task submission to Jedi failed %s" %tmpOut[1])
return False
logger.info("Task submission to Jedi suceeded with new jediTaskID=%s" %tmpOut[1])
#if buildjobspec:
# job.backend.buildjob = PandaBuildJob()
# job.backend.buildjob.id = jobids[0][0]
# job.backend.buildjob.url = 'http://panda.cern.ch/?job=%d'%jobids[0][0]
# del jobids[0]
for subjob in rjobs:
subjob.backend.id = tmpOut[1]
subjob.backend.url = 'http://pandamon.cern.ch/jedi/taskinfo?days=20&task=%d'%tmpOut[1]
subjob.updateStatus('submitted')
logger.info("Panda monitor url: %s" %subjob.backend.url)
return True