Skip to content

Commit

Permalink
Rename CMSTaskType to extendedTaskType
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenyi Hurtado Anampa committed Aug 3, 2023
1 parent d61d9e5 commit f7cd8d4
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 18 deletions.
6 changes: 3 additions & 3 deletions src/python/WMComponent/JobCreator/JobCreatorPoller.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def saveJob(job, thisJobNumber, **kwargs):
job['requiresGPU'] = kwargs['requiresGPU']
job['gpuRequirements'] = kwargs['gpuRequirements']
job['requestType'] = kwargs['requestType']
job['CMSTaskType'] = kwargs['CMSTaskType']
job['extendedTaskType'] = kwargs['extendedTaskType']

with open(os.path.join(cacheDir, 'job.pkl'), 'wb') as output:
pickle.dump(job, output, HIGHEST_PICKLE_PROTOCOL)
Expand Down Expand Up @@ -454,7 +454,7 @@ def pollSubscriptions(self):
# Set task object
wmTask = wmWorkload.getTaskByPath(workflow.task)
# Create the CMS task type
wmTask.setCMSTaskType()
wmTask.setExtendedTaskType()

# Get generators
# If you fail to load the generators, pass on the job
Expand Down Expand Up @@ -543,7 +543,7 @@ def pollSubscriptions(self):
'agentNumber': self.agentNumber,
'agentName': self.agentName,
'allowOpportunistic': allowOpport,
'CMSTaskType': wmTask.CMSTaskType()}
'extendedTaskType': wmTask.extendedTaskType()}

tempSubscription = Subscription(id=wmbsSubscription['id'])

Expand Down
2 changes: 1 addition & 1 deletion src/python/WMCore/BossAir/Plugins/SimpleCondorPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ def getJobParameters(self, jobList):
ad['My.CMS_JobType'] = classad.quote(job['task_type'])
ad['My.CMS_Type'] = classad.quote(activityToType(job['activity']))
ad['My.CMS_RequestType'] = classad.quote(job['requestType'])
ad['My.CMS_TaskType'] = classad.quote(job['CMSTaskType'])
ad['My.CMS_extendedJobType'] = classad.quote(job['extendedTaskType'])

# Handling for AWS, cloud and opportunistic resources
ad['My.AllowOpportunistic'] = str(job.get('allowOpportunistic', False))
Expand Down
2 changes: 1 addition & 1 deletion src/python/WMCore/WMSpec/StdSpecs/StdBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ def setupProcessingTask(self, procTask, taskType, inputDataset=None, inputStep=N
gracePeriod=taskConf.get("GracePeriod", None))

# create CMS task type
procTask.setCMSTaskType()
procTask.setExtendedTaskType()
return outputModules

def _getDictionaryParams(self, prop, key, default=None):
Expand Down
25 changes: 12 additions & 13 deletions src/python/WMCore/WMSpec/WMTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -1340,38 +1340,37 @@ def getStepTypes(self):
types.append(stepType)
return types

def CMSTaskType(self):
def extendedTaskType(self):
"""
_getCMSTaskType_
_extendedTaskType_
Return the CMS Task type
Return the extended Task type
"""
return self.data.CMSTaskType

def setCMSTaskType(self):
def setExtendedTaskType(self):
"""
_setCMSType_
_setExtendedType_
Set the CMS task type based on the steps parameter
Set the extended task type based on the steps parameter
for all steps.
We basically expand the standard "Production" taskType to
detail the process better.
From "Processing" to ["GENSIM", "GEN", "DIGI", "RECO", "DIGIRECO", "MINIAOD"]
CMStypes = ["DataProcessing", "GENSIM", "GEN", "DIGI", "RECO", "DIGIRECO", "MINIAOD",
extendedTypes = ["DataProcessing", "GENSIM", "GEN", "DIGI", "RECO", "DIGIRECO", "MINIAOD",
"LogCollect", "Skim", "Merge", "Harvesting",
"Cleanup", "Repack", "Express"]
"""
cmsType = "Unknown"
extendedTaskType = "Unknown"
if self.taskType() == "Processing":
cmsType = "DataProcessing"
extendedTaskType = "DataProcessing"
elif self.taskType() == "Production":
stepTypes = self.getStepTypes()
cmsType = ",".join(stepTypes)
extendedTaskType = ",".join(stepTypes)
else:
cmsType = self.taskType()
extendedTaskType = self.taskType()

logging.info("CMSTaskType = %s", cmsType)
self.data.CMSTaskType = cmsType
self.data.extendedTaskType = extendedTaskType

def setProcessingVersion(self, procVer, parentProcessingVersion=0, stepChainMap=False):
"""
Expand Down

0 comments on commit f7cd8d4

Please sign in to comment.