本文整理汇总了Python中taskbuffer.FileSpec.FileSpec.prodDBlockToken方法的典型用法代码示例。如果您正苦于以下问题:Python FileSpec.prodDBlockToken方法的具体用法?Python FileSpec.prodDBlockToken怎么用?Python FileSpec.prodDBlockToken使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类taskbuffer.FileSpec.FileSpec
的用法示例。
在下文中一共展示了FileSpec.prodDBlockToken方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: convertToJobFileSpec
# 需要导入模块: from taskbuffer.FileSpec import FileSpec [as 别名]
# 或者: from taskbuffer.FileSpec.FileSpec import prodDBlockToken [as 别名]
def convertToJobFileSpec(self,datasetSpec,setType=None,useEventService=False):
jobFileSpec = JobFileSpec()
jobFileSpec.fileID = self.fileID
jobFileSpec.datasetID = datasetSpec.datasetID
jobFileSpec.jediTaskID = datasetSpec.jediTaskID
jobFileSpec.lfn = self.lfn
jobFileSpec.GUID = self.GUID
if setType == None:
jobFileSpec.type = self.type
else:
jobFileSpec.type = setType
jobFileSpec.scope = self.scope
jobFileSpec.fsize = self.fsize
jobFileSpec.checksum = self.checksum
jobFileSpec.attemptNr = self.attemptNr
# dataset attribute
if datasetSpec != None:
# dataset
if not datasetSpec.containerName in [None,'']:
jobFileSpec.dataset = datasetSpec.containerName
else:
jobFileSpec.dataset = datasetSpec.datasetName
if self.type in datasetSpec.getInputTypes() or setType in datasetSpec.getInputTypes():
# prodDBlock
jobFileSpec.prodDBlock = datasetSpec.datasetName
# storage token
if not datasetSpec.storageToken in ['',None]:
jobFileSpec.dispatchDBlockToken = datasetSpec.storageToken
else:
# destinationDBlock
jobFileSpec.destinationDBlock = datasetSpec.datasetName
# storage token
if not datasetSpec.storageToken in ['',None]:
jobFileSpec.destinationDBlockToken = datasetSpec.storageToken.split('/')[0]
# destination
if not datasetSpec.destination in ['',None]:
jobFileSpec.destinationSE = datasetSpec.destination
# set prodDBlockToken for Event Service
if useEventService and datasetSpec.getObjectStore() != None:
jobFileSpec.prodDBlockToken = 'objectstore^{0}'.format(datasetSpec.getObjectStore())
# allow no output
if datasetSpec.isAllowedNoOutput():
jobFileSpec.allowNoOutput()
# return
return jobFileSpec
示例2: prepare
# 需要导入模块: from taskbuffer.FileSpec import FileSpec [as 别名]
# 或者: from taskbuffer.FileSpec.FileSpec import prodDBlockToken [as 别名]
def prepare(self,app,appconfig,appmasterconfig,jobmasterconfig):
'''prepare the subjob specific configuration'''
# PandaTools
from pandatools import Client
from pandatools import AthenaUtils
from taskbuffer.JobSpec import JobSpec
from taskbuffer.FileSpec import FileSpec
job = app._getParent()
logger.debug('AthenaMCPandaRTHandler prepare called for %s', job.getFQID('.'))
try:
assert self.outsite
except:
logger.error("outsite not set. Aborting")
raise Exception()
job.backend.site = self.outsite
job.backend.actualCE = self.outsite
cloud = job._getRoot().backend.requirements.cloud
job.backend.requirements.cloud = cloud
# now just filling the job from AthenaMC data
jspec = JobSpec()
jspec.jobDefinitionID = job._getRoot().id
jspec.jobName = commands.getoutput('uuidgen 2> /dev/null')
jspec.AtlasRelease = 'Atlas-%s' % app.atlas_rel
if app.transform_archive:
jspec.homepackage = 'AnalysisTransforms'+app.transform_archive
elif app.prod_release:
jspec.homepackage = 'AnalysisTransforms-AtlasProduction_'+str(app.prod_release)
jspec.transformation = '%s/runAthena-00-00-11' % Client.baseURLSUB
#---->???? prodDBlock and destinationDBlock when facing several input / output datasets?
jspec.prodDBlock = 'NULL'
if job.inputdata and len(app.inputfiles)>0 and app.inputfiles[0] in app.dsetmap:
jspec.prodDBlock = app.dsetmap[app.inputfiles[0]]
# How to specify jspec.destinationDBlock when more than one type of output is available? Panda prod jobs seem to specify only the last output dataset
outdset=""
for type in ["EVNT","RDO","HITS","AOD","ESD","NTUP"]:
if type in app.outputpaths.keys():
outdset=string.replace(app.outputpaths[type],"/",".")
outdset=outdset[1:-1]
break
if not outdset:
try:
assert len(app.outputpaths.keys())>0
except:
logger.error("app.outputpaths is empty: check your output datasets")
raise
type=app.outputpaths.keys()[0]
outdset=string.replace(app.outputpaths[type],"/",".")
outdset=outdset[1:-1]
jspec.destinationDBlock = outdset
jspec.destinationSE = self.outsite
jspec.prodSourceLabel = 'user'
jspec.assignedPriority = 1000
jspec.cloud = cloud
# memory
if job.backend.requirements.memory != -1:
jspec.minRamCount = job.backend.requirements.memory
jspec.computingSite = self.outsite
jspec.cmtConfig = AthenaUtils.getCmtConfig(athenaVer=app.atlas_rel)
# library (source files)
flib = FileSpec()
flib.lfn = self.library
# flib.GUID =
flib.type = 'input'
# flib.status =
flib.dataset = self.libDataset
flib.dispatchDBlock = self.libDataset
jspec.addFile(flib)
# input files FIXME: many more input types
for lfn in app.inputfiles:
useguid=app.turls[lfn].replace("guid:","")
finp = FileSpec()
finp.lfn = lfn
finp.GUID = useguid
finp.dataset = app.dsetmap[lfn]
finp.prodDBlock = app.dsetmap[lfn]
finp.prodDBlockToken = 'local'
finp.dispatchDBlock = app.dsetmap[lfn]
finp.type = 'input'
finp.status = 'ready'
jspec.addFile(finp)
# add dbfiles if any:
for lfn in app.dbfiles:
useguid=app.dbturls[lfn].replace("guid:","")
finp = FileSpec()
finp.lfn = lfn
finp.GUID = useguid
finp.dataset = app.dsetmap[lfn]
#.........这里部分代码省略.........