From 1ce66978e6813271d0b2aa6b1d138ecd0ec446b3 Mon Sep 17 00:00:00 2001 From: Giovanni Franzoni Date: Fri, 1 Nov 2019 10:46:02 +0100 Subject: [PATCH 1/5] added option to use T3 credentials --- SubmitHGCalPGun.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/SubmitHGCalPGun.py b/SubmitHGCalPGun.py index df8f915..c5865df 100644 --- a/SubmitHGCalPGun.py +++ b/SubmitHGCalPGun.py @@ -56,6 +56,7 @@ def createParser(): parser.add_option('', '--storePFCandidates', action='store_true', dest='storePFCandidates', default=False, help='store PFCandidates collection') parser.add_option('', '--multiClusterTag', action='store', dest='MULTICLUSTAG', default="hgcalMultiClusters", help='name of HGCalMultiCluster InputTag - use hgcalLayerClusters before CMSSW_10_3_X') parser.add_option('', '--keepDQMfile', action='store_true', dest='DQM', default=False, help='store the DQM file in relevant folder locally or in EOS, default is False.') + parser.add_option('', '--useT3', action='store_true', dest='useT3', default=False, help='use the t3-specific share of the CERN HTCondor; adds a line to the condor .sub file') return parser @@ -129,10 +130,10 @@ def parseOptions(parser=None, opt=None): ### processing the external os commands -def processCmd(cmd, quite = 0): +def processCmd(cmd, quiet = 0): #print cmd status, output = commands.getstatusoutput(cmd) - if (status !=0 and not quite): + if (status !=0 and not quiet): print 'Error in processing command:\n ['+cmd+']' print 'Output:\n ['+output+'] \n' return output @@ -146,6 +147,8 @@ def printSetup(opt, CMSSW_BASE, CMSSW_VERSION, SCRAM_ARCH, currentDir, outDir): print 'CMSSW BASE: ', CMSSW_BASE print 'CMSSW VER: ', CMSSW_VERSION,'[', SCRAM_ARCH, ']' print 'CONFIGFILE: ', opt.CONFIGFILE + if opt.useT3: + print '(using the T3 condor group for the submissions)' # relval takes precedence... if (opt.RELVAL == ''): curr_input= opt.inDir @@ -249,6 +252,7 @@ def submitHGCalProduction(*args, **kwargs): elif (opt.DTIER == 'GSD'): outDir = "_".join([partGunType, tag]).replace(":", "_") if (not os.path.isdir(outDir)): + # GF: option to send the logs in eos... processCmd('mkdir -p '+outDir+'/cfg/') processCmd('mkdir -p '+outDir+'/std/') processCmd('mkdir -p '+outDir+'/jobs/') @@ -299,7 +303,7 @@ def submitHGCalProduction(*args, **kwargs): print '[Submitting jobs]' jobCount=0 - # read the template file in a single string + # read the CMSSW .py template file in a single string f_template= open(opt.CONFIGFILE, 'r') template= f_template.read() f_template.close() @@ -413,6 +417,8 @@ def submitHGCalProduction(*args, **kwargs): write_condorjob= open(outDir+'/jobs/'+jobfile, 'w') write_condorjob.write('+JobFlavour = "'+opt.QUEUE+'" \n\n') + if opt.useT3: + write_condorjob.write('+AccountingGroup = "group_u_CMST3.all"\n') write_condorjob.write('executable = '+currentDir+'/SubmitFileGSD.sh \n') write_condorjob.write('arguments = $(ClusterID) $(ProcId) '+currentDir+' '+outDir+' '+cfgfile+' '+str(opt.LOCAL)+' '+CMSSW_VERSION+' '+CMSSW_BASE+' '+SCRAM_ARCH+' '+opt.eosArea+' '+opt.DTIER+' '+str(opt.DQM)+'\n') write_condorjob.write('output = '+outDir+'/std/'+basename+'.out \n') From 189497dcca8e4718d5104bba3e6c7445ba6cc7f0 Mon Sep 17 00:00:00 2001 From: Giovanni Franzoni Date: Fri, 1 Nov 2019 10:46:20 +0100 Subject: [PATCH 2/5] produceSkeletons_D41_NoSmear_noPU.sh takes geometry , custom and conditions as parameters: a way of enabling the usage of V11 HGCAL geometry --- .../produceSkeletons_D41_NoSmear_noPU.sh | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/templates/python/produceSkeletons_D41_NoSmear_noPU.sh b/templates/python/produceSkeletons_D41_NoSmear_noPU.sh index ebda91b..860d562 100755 --- a/templates/python/produceSkeletons_D41_NoSmear_noPU.sh +++ b/templates/python/produceSkeletons_D41_NoSmear_noPU.sh @@ -33,6 +33,9 @@ action() { # default arguments local inject_ticl="1" + local geometry="Extended2026D41" + local custom="" + local conditions="auto:phase2_realistic" # parse arguments for arg in "$@"; do @@ -40,6 +43,15 @@ action() { inject_ticl="1" elif [ "$arg" = "no-ticl" ]; then inject_ticl="0" + elif [[ $arg =~ "geometry" ]]; then + geometry=${arg/geometry=/} + echo "Geometry modified to: $geometry" + elif [[ $arg =~ "custom" ]]; then + custom=${arg/custom=/} + echo "Custom options (full command needed): $custom" + elif [[ $arg =~ "conditions" ]]; then + conditions=${arg/conditions=/} + echo "Global tag modified to: $conditions" else 2>&1 echo "unknown argument: $arg" return "1" @@ -48,27 +60,29 @@ action() { cmsDriver.py SinglePiPt25Eta1p7_2p7_cfi \ - --conditions auto:phase2_realistic \ + --conditions ${conditions} \ -n 10 \ --era Phase2C8 \ --eventcontent FEVTDEBUGHLT \ -s GEN,SIM,DIGI:pdigi_valid,L1,L1TrackTrigger,DIGI2RAW,HLT:@fake2 \ --datatier GEN-SIM \ --beamspot NoSmear \ - --geometry Extended2026D41 \ + ${custom} \ + --geometry ${geometry} \ --no_exec \ --python_filename=GSD_fragment.py cmsDriver.py step3 \ - --conditions auto:phase2_realistic \ + --conditions ${conditions} \ -n 10 \ --era Phase2C8 \ --eventcontent FEVTDEBUGHLT,DQM \ --runUnscheduled \ -s RAW2DIGI,L1Reco,RECO,RECOSIM,VALIDATION:@phase2Validation,DQM:@phase2 \ --datatier GEN-SIM-RECO,DQMIO \ - --geometry Extended2026D41 \ + ${custom} \ + --geometry ${geometry} \ --no_exec \ --python_filename=RECO_fragment.py @@ -86,14 +100,15 @@ action() { cmsDriver.py step3 \ - --conditions auto:phase2_realistic \ + --conditions ${conditions} \ -n 10 \ --era Phase2C8 \ --eventcontent FEVTDEBUGHLT \ --runUnscheduled \ -s RAW2DIGI,L1Reco,RECO,RECOSIM \ --datatier GEN-SIM-RECO \ - --geometry Extended2026D41 \ + ${custom} \ + --geometry ${geometry} \ --no_exec \ --processName=NTUP \ --python_filename=NTUP_fragment.py From 4d7bd8febf773bd7b798ffb1aaa6b8cf83133fd7 Mon Sep 17 00:00:00 2001 From: Giovanni Franzoni Date: Fri, 1 Nov 2019 11:16:50 +0100 Subject: [PATCH 3/5] produceSkeletons_D41_NoSmear_PU_AVE_200_BX_25ns_aged.sh ALSO conditions as a parameter: a way of enabling the usage of V11 HGCAL geometry (ops for geometry and custom were alrady there) --- ...uceSkeletons_D41_NoSmear_PU_AVE_200_BX_25ns_aged.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/templates/python/produceSkeletons_D41_NoSmear_PU_AVE_200_BX_25ns_aged.sh b/templates/python/produceSkeletons_D41_NoSmear_PU_AVE_200_BX_25ns_aged.sh index a3c1ac8..93c3e32 100755 --- a/templates/python/produceSkeletons_D41_NoSmear_PU_AVE_200_BX_25ns_aged.sh +++ b/templates/python/produceSkeletons_D41_NoSmear_PU_AVE_200_BX_25ns_aged.sh @@ -38,6 +38,7 @@ action() { local geometry="Extended2026D41" local pileup_input="das:/RelValMinBias_14TeV/CMSSW_10_6_0_patch2-106X_upgrade2023_realistic_v3_2023D41noPU-v1/GEN-SIM" local custom="" + local conditions="auto:phase2_realistic" # parse arguments for arg in "$@"; do @@ -51,6 +52,9 @@ action() { elif [[ $arg =~ ^"custom" ]]; then custom=${arg/custom=/} echo "Custom options $custom" + elif [[ $arg =~ "conditions" ]]; then + conditions=${arg/conditions=/} + echo "Global tag modified to: $conditions" elif [[ $arg =~ ^"pileup_input" ]]; then pileup_input=${arg/pileup_input=/} #if das is not given try to build the list of files by listing the local directory given @@ -66,7 +70,7 @@ action() { done cmsDriver.py TTbar_14TeV_TuneCUETP8M1_cfi \ - --conditions auto:phase2_realistic \ + --conditions ${conditions} \ -n 10 \ --era Phase2C8 \ --eventcontent FEVTDEBUGHLT \ @@ -82,7 +86,7 @@ action() { cmsDriver.py step3 \ - --conditions auto:phase2_realistic \ + --conditions ${conditions} \ -n 10 \ --era Phase2C8 \ --eventcontent FEVTDEBUGHLT,DQM \ @@ -107,7 +111,7 @@ action() { cmsDriver.py step3 \ - --conditions auto:phase2_realistic \ + --conditions ${conditions} \ -n 10 \ --era Phase2C8 \ --eventcontent FEVTDEBUGHLT \ From aae5dc8d858ac8b10f2578d6e83cbb47f5b72b90 Mon Sep 17 00:00:00 2001 From: Giovanni Franzoni Date: Fri, 1 Nov 2019 11:57:38 +0100 Subject: [PATCH 4/5] better display for new option --- SubmitHGCalPGun.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SubmitHGCalPGun.py b/SubmitHGCalPGun.py index c5865df..ebd3cc4 100644 --- a/SubmitHGCalPGun.py +++ b/SubmitHGCalPGun.py @@ -147,8 +147,6 @@ def printSetup(opt, CMSSW_BASE, CMSSW_VERSION, SCRAM_ARCH, currentDir, outDir): print 'CMSSW BASE: ', CMSSW_BASE print 'CMSSW VER: ', CMSSW_VERSION,'[', SCRAM_ARCH, ']' print 'CONFIGFILE: ', opt.CONFIGFILE - if opt.useT3: - print '(using the T3 condor group for the submissions)' # relval takes precedence... if (opt.RELVAL == ''): curr_input= opt.inDir @@ -166,6 +164,8 @@ def printSetup(opt, CMSSW_BASE, CMSSW_VERSION, SCRAM_ARCH, currentDir, outDir): print 'OUTPUT DIR: ', outDir print 'QUEUE: ', opt.QUEUE print ['NUM. EVTS: '+str(opt.NEVTS), ''][int(opt.DTIER!='GSD')] + if opt.useT3: + print 'CONDOR: using the T3 condor group for the submissions' print '--------------------' ### prepare the list of input GSD files for RECO stage From c0afbeb53580b28c25ddba232f14bb39dda40817 Mon Sep 17 00:00:00 2001 From: Giovanni Franzoni Date: Fri, 1 Nov 2019 12:14:41 +0100 Subject: [PATCH 5/5] better display for new option --- SubmitHGCalPGun.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SubmitHGCalPGun.py b/SubmitHGCalPGun.py index ebd3cc4..2c560ad 100644 --- a/SubmitHGCalPGun.py +++ b/SubmitHGCalPGun.py @@ -165,7 +165,7 @@ def printSetup(opt, CMSSW_BASE, CMSSW_VERSION, SCRAM_ARCH, currentDir, outDir): print 'QUEUE: ', opt.QUEUE print ['NUM. EVTS: '+str(opt.NEVTS), ''][int(opt.DTIER!='GSD')] if opt.useT3: - print 'CONDOR: using the T3 condor group for the submissions' + print 'CONDOR: using the T3 condor group for the submissions' print '--------------------' ### prepare the list of input GSD files for RECO stage