From dfbc29f8e1390cd47f03328c48f215a1803836fa Mon Sep 17 00:00:00 2001 From: Antonio Linares Date: Fri, 22 Nov 2024 17:10:18 -0600 Subject: [PATCH] Less prone to error approach --- etc/HIReplayOfflineConfiguration.py | 9 +++++-- etc/ReplayOfflineConfiguration.py | 6 +++-- src/python/T0/RunConfig/RunConfigAPI.py | 33 ++++++++++++++++++------- 3 files changed, 35 insertions(+), 13 deletions(-) diff --git a/etc/HIReplayOfflineConfiguration.py b/etc/HIReplayOfflineConfiguration.py index 207844e0e..7cb9b9222 100644 --- a/etc/HIReplayOfflineConfiguration.py +++ b/etc/HIReplayOfflineConfiguration.py @@ -39,7 +39,7 @@ # Set run number to replay # 374951: HI 2023 3.8 TB # 387456: Test HI 2024 with memory problems 3.1 TB -setInjectRuns(tier0Config, [388620, 388621]) +setInjectRuns(tier0Config, [387708, 388621]) # Settings up sites processingSite = "T2_CH_CERN" @@ -64,7 +64,12 @@ # Data type # Processing site (where jobs run) # PhEDEx locations -setAcquisitionEra(tier0Config, {'run': 388621, 'era': "Tier0_TEST_HIREPLAY_2024"}) + +setAcquisitionEra(tier0Config, {"Tier0_REPLAY_2024": 388619, # {era_name : max run for that era} + "Tier0_HIREPLAY_2024": 389000, + "Tier0_TEST_ERA3_2024": 9999999 + }) + setBaseRequestPriority(tier0Config, 260000) setBackfill(tier0Config, 1) setBulkDataType(tier0Config, "hidata") diff --git a/etc/ReplayOfflineConfiguration.py b/etc/ReplayOfflineConfiguration.py index 16240d4c7..b7a7b5374 100644 --- a/etc/ReplayOfflineConfiguration.py +++ b/etc/ReplayOfflineConfiguration.py @@ -40,7 +40,7 @@ # 382686 - Collisions, 43.3 pb-1, 23.9583 TB NEW # 386674 Cosmics ~40 minutes in Run2024I with occupancy issues -setInjectRuns(tier0Config, [382686, 386674]) +setInjectRuns(tier0Config, [380128, 382686, 386925]) # Use this in order to limit the number of lumisections to process #setInjectLimit(tier0Config, 10) @@ -68,7 +68,9 @@ # Data type # Processing site (where jobs run) # PhEDEx locations -setAcquisitionEra(tier0Config, "Tier0_REPLAY_2024") +setAcquisitionEra(tier0Config, {"Tier0_REPLAY_2024A": 382686, # {era_name : max run for that era} + "Tier0_REPLAY_2024B": 9999999 + }) setBaseRequestPriority(tier0Config, 260000) setBackfill(tier0Config, 1) setBulkDataType(tier0Config, "data") diff --git a/src/python/T0/RunConfig/RunConfigAPI.py b/src/python/T0/RunConfig/RunConfigAPI.py index 89bc09816..97241e30e 100644 --- a/src/python/T0/RunConfig/RunConfigAPI.py +++ b/src/python/T0/RunConfig/RunConfigAPI.py @@ -53,6 +53,22 @@ def extractConfigParameter(configParameter, era, run): else: return configParameter +def getAcquisitionEra(tier0Config, run): + """ + _getAcquisitionEra_ + + Determines the acquisition era based on the current run + """ + if isinstance(tier0Config.Global.AcquisitionEra, dict): + for era in tier0Config.Global.AcquisitionEra: + if run <= tier0Config.Global.AcquisitionEra[era]: + acqEra = era + break + else: + acqEra = tier0Config.Global.AcquisitionEra + + return acqEra + def configureRun(tier0Config, run, hltConfig, referenceHltConfig = None): """ _configureRun_ @@ -119,11 +135,9 @@ def configureRun(tier0Config, run, hltConfig, referenceHltConfig = None): if runInfo['setup_label'] == 'Emulation': bindsUpdateRun['ACQERA'] = tier0Config.Global.EmulationAcquisitionEra - elif isinstance(tier0Config.Global.AcquisitionEra, dict) and run >= tier0Config.Global.AcquisitionEra['run']: - bindsUpdateRun['ACQERA'] = tier0Config.Global.AcquisitionEra['era'] - else: - bindsUpdateRun['ACQERA'] = tier0Config.Global.AcquisitionEra + bindsUpdateRun['ACQERA'] = getAcquisitionEra(tier0Config, run) + bindsStream = [] bindsDataset = [] @@ -552,13 +566,13 @@ def configureRunStream(tier0Config, run, stream, specDirectory, dqmUploadProxy): outputs = {} blockCloseDelay = None taskName = None + acqEra = getAcquisitionEra(tier0Config, run) if streamConfig.ProcessingStyle == "Bulk": taskName = "Repack" - if tier0Config.Global.EnableUniqueWorkflowName: workflowName = "Repack_Run%d_Stream%s_%s_ID%d_v%s" % (run, stream, - tier0Config.Global.AcquisitionEra, tier0Config.Global.DeploymentID, streamConfig.Repack.ProcessingVersion) + acqEra, tier0Config.Global.DeploymentID, streamConfig.Repack.ProcessingVersion) else: workflowName = "Repack_Run%d_Stream%s" % (run, stream) @@ -608,7 +622,7 @@ def configureRunStream(tier0Config, run, stream, specDirectory, dqmUploadProxy): if tier0Config.Global.EnableUniqueWorkflowName: workflowName = "Express_Run%d_Stream%s_%s_ID%d_v%s" % (run, stream, - tier0Config.Global.AcquisitionEra, tier0Config.Global.DeploymentID, streamConfig.Express.ProcessingVersion) + acqEra, tier0Config.Global.DeploymentID, streamConfig.Express.ProcessingVersion) else: workflowName = "Express_Run%d_Stream%s" % (run, stream) @@ -829,7 +843,7 @@ def releasePromptReco(tier0Config, specDirectory, dqmUploadProxy): # retrieve phedex configs for run getPhEDExConfigDAO = daoFactory(classname = "RunConfig.GetPhEDExConfig") phedexConfigs = getPhEDExConfigDAO.execute(run, transaction = False) - + for (dataset, fileset, repackProcVer) in recoRelease[run]: bindsReleasePromptReco.append( { 'RUN' : run, @@ -1018,8 +1032,9 @@ def releasePromptReco(tier0Config, specDirectory, dqmUploadProxy): taskName = "Reco" if tier0Config.Global.EnableUniqueWorkflowName: + acqEra = getAcquisitionEra(tier0Config, run) workflowName = "PromptReco_Run%d_%s_%s_ID%d_v%s" % (run, dataset, - tier0Config.Global.AcquisitionEra, tier0Config.Global.DeploymentID, datasetConfig.ProcessingVersion) + acqEra, tier0Config.Global.DeploymentID, datasetConfig.ProcessingVersion) else: workflowName = "PromptReco_Run%d_%s" % (run, dataset)