File indexing completed on 2024-04-06 12:03:13
0001
0002
0003
0004
0005
0006
0007
0008 pflag=0
0009 while getopts 'ph' OPTION
0010 do
0011 case $OPTION in
0012 p) pflag=1
0013 ;;
0014 h) echo "Usage: [-p]"
0015 echo " -p: centrally installed release, not on local machine"
0016 exit
0017 ;;
0018 esac
0019 done
0020 shift $(($OPTIND - 1))
0021
0022
0023
0024
0025
0026 release=CMSSW_4_2_3_ONLINE
0027
0028
0029 emulatorRelease=CMSSW_4_2_3
0030 version=011
0031
0032
0033
0034
0035
0036
0037 writtenFile=~popcondev/L1Job/${release}/validate-l1Key/writtenTscKeys.txt
0038
0039
0040
0041
0042
0043
0044 summaryFile=/nfshome0/popcondev/L1Job/o2o.summary
0045
0046
0047
0048
0049
0050
0051 logFile=/nfshome0/popcondev/L1Job/validate-l1Key-${version}.log
0052
0053
0054
0055
0056
0057 semaphoreFile=/nfshome0/popcondev/L1Job/${release}/validate-l1Key/validate-l1Key.lock
0058
0059 if [ -f ${semaphoreFile} ]
0060 then
0061 echo "`date` : validate-l1Key.sh" >> ${logFile}
0062 echo "$0 already running. Aborting process. Check for hung jobs from previous call of validate-l1Key.sh." | tee -a ${logFile}
0063 tail -3 ${logFile} >> /nfshome0/popcondev/L1Job/o2o.summary
0064 exit 50
0065 else
0066 touch ${semaphoreFile}
0067 fi
0068
0069
0070
0071 trap "rm -f ${semaphoreFile}; mv /nfshome0/popcondev/L1Job/${release}/validate-l1Key/temp.log /nfshome0/popcondev/L1Job/${release}/validate-l1Key/temp.log.save; mv /nfshome0/popcondev/L1Job/${emulatorRelease}/validate-l1Key/temp.log /nfshome0/popcondev/L1Job/${emulatorRelease}/validate-l1Key/temp.log.save; exit" 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
0072
0073
0074
0075
0076
0077
0078 cd /nfshome0/popcondev/L1Job/${release}/validate-l1Key
0079
0080 if [ ${pflag} -eq 0 ]
0081 then
0082 export SCRAM_ARCH=""
0083 export VO_CMS_SW_DIR=""
0084 source /opt/cmssw/cmsset_default.sh
0085 else
0086 source /nfshome0/cmssw2/scripts/setup.sh
0087 centralRel="-p"
0088 fi
0089 eval `scramv1 run -sh`
0090
0091
0092
0093
0094
0095 if [ ! -f ${writtenFile} ]
0096 then
0097 touch ${writtenFile}
0098 fi
0099
0100
0101 for KEY in `$CMSSW_BASE/src/CondTools/L1Trigger/scripts/getValidTscKeys.sh`
0102 do
0103 if [ -z "${tsc_key}" ]
0104 then
0105 last=`grep ${KEY} writtenTscKeys.txt`
0106 if [ -n "${last}" ]
0107 then
0108 status=`echo ${last} | cut -f 2 -d ' '`
0109
0110 else
0111
0112 tsc_key=${KEY}
0113 fi
0114 fi
0115 done
0116
0117 if [ -z "${tsc_key}" ]
0118 then
0119
0120 rm -f ${semaphoreFile}
0121 exit 0
0122 fi
0123
0124
0125
0126
0127
0128 echo "`date` : validate-l1Key.sh" >> ${logFile}
0129 echo "tsc_key = ${tsc_key}" >> ${logFile}
0130 echo "O2O release ${release}$" >> ${logFile}
0131
0132
0133
0134
0135
0136 /nfshome0/l1emulator/o2o/o2o-tscKey-slc5.sh ${tsc_key}
0137 o2ocode3=$?
0138
0139 if [ ${o2ocode3} -eq 0 ]
0140 then
0141 writeStatus="successful"
0142 else
0143 writeStatus="failed"
0144 fi
0145
0146
0147
0148
0149
0150 rm -f temp.log
0151
0152 $CMSSW_BASE/src/CondTools/L1Trigger/scripts/getConditions.sh -n ${centralRel} ${tsc_key} >& temp.log
0153 o2ocode1=$?
0154
0155 cat temp.log >> ${logFile}
0156 rm -f temp.log
0157
0158 echo "getConditions status ${o2ocode1}" >> ${logFile}
0159 echo "" >> ${logFile}
0160
0161
0162
0163
0164
0165
0166
0167
0168
0169
0170
0171 if [ ${o2ocode1} -eq 0 ]
0172 then
0173 echo "Running emulator job in ${emulatorRelease}" >> ${logFile}
0174 cd /nfshome0/popcondev/L1Job/${emulatorRelease}/validate-l1Key
0175 ln -sf /nfshome0/popcondev/L1Job/${release}/validate-l1Key/l1config.db .
0176 ln -sf /nfshome0/popcondev/L1Job/${release}/validate-l1Key/Raw.root .
0177
0178 export SCRAM_ARCH=slc5_amd64_gcc434
0179
0180 source /nfshome0/cmssw2/scripts/setup.sh
0181
0182 eval `scramv1 run -sh`
0183 ln -sf $CMSSW_BASE/src/CondTools/L1Trigger/test/validate-l1Key.py .
0184 cmsRun validate-l1Key.py >& temp.log
0185 o2ocode2=$?
0186
0187 cat temp.log >> ${logFile}
0188 rm -f temp.log
0189
0190 echo "emulator status ${o2ocode2}" >> ${logFile}
0191 echo "" >> ${logFile}
0192 fi
0193
0194
0195
0196
0197
0198
0199 rm -f /nfshome0/popcondev/L1Job/${release}/validate-l1Key/l1config.db
0200
0201 o2ocode=`echo ${o2ocode1} + ${o2ocode2} | bc`
0202
0203 echo "tsc_key = ${tsc_key}" >> ${logFile}
0204 echo "getConditions status ${o2ocode1}" >> ${logFile}
0205 echo "emulator status ${o2ocode2}" >> ${logFile}
0206 echo "exit code ${o2ocode}" >> ${logFile}
0207 if [ ${o2ocode} -eq 0 ]
0208 then
0209 echo "L1-O2O-INFO: successful" >> ${logFile}
0210 validationStatus="successful"
0211 else
0212 echo "L1-O2O-INFO: failed" >> ${logFile}
0213 validationStatus="failed"
0214
0215 fi
0216 echo "`date` : validate-l1Key.sh finished" >> ${logFile}
0217
0218 tail -6 ${logFile} >> ${summaryFile}
0219 echo "" >> ${logFile}
0220
0221
0222
0223
0224
0225
0226
0227
0228
0229
0230
0231
0232
0233
0234
0235
0236
0237 o2ocode=`echo ${o2ocode} + ${o2ocode3} | bc`
0238
0239
0240 echo "${tsc_key} ${validationStatus} ${writeStatus}" >> ${writtenFile}
0241
0242
0243 rm -f ${semaphoreFile}
0244
0245 exit ${o2ocode}