Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:52:17

0001 #!/bin/sh
0002 
0003 # L1Trigger O2O - set IOVs
0004 
0005 nflag=0
0006 oflag=0
0007 pflag=0
0008 while getopts 'noph' OPTION
0009   do
0010   case $OPTION in
0011       n) nflag=1
0012           ;;
0013       o) oflag=1
0014           ;;
0015       p) pflag=1
0016           ;;
0017       h) echo "Usage: [-n] runnum tsckey"
0018           echo "  -n: no RS"
0019           echo "  -o: overwrite RS keys"
0020           echo "  -p: centrally installed release, not on local machine"
0021           exit
0022           ;;
0023   esac
0024 done
0025 shift $(($OPTIND - 1))
0026 
0027 # arguments
0028 run=$1
0029 key=$2
0030 
0031 release=CMSSW_3_5_0
0032 version=007
0033 
0034 echo "`date` : o2o-setIOV-slc5.sh $run $key" | tee -a /nfshome0/popcondev/L1Job/o2o-setIOV-${version}.log
0035 
0036 if [ $# -lt 2 ]
0037     then
0038     echo "Wrong number of arguments.  Usage: $0 [-n] runnum tsckey" | tee -a /nfshome0/popcondev/L1Job/o2o-setIOV-${version}.log
0039     exit 127
0040 fi
0041 
0042 # set up environment variables
0043 cd /cmsnfshome0/nfshome0/popcondev/L1Job/${release}/o2o
0044 
0045 if [ ${pflag} -eq 0 ]
0046     then
0047     export SCRAM_ARCH=""
0048     export VO_CMS_SW_DIR=""
0049     source /opt/cmssw/cmsset_default.sh
0050 else
0051     source /nfshome0/cmssw2/scripts/setup.sh
0052     centralRel="-p"
0053 fi
0054 eval `scramv1 run -sh`
0055 
0056 # Check for semaphore file
0057 if [ -f o2o-setIOV.lock ]
0058     then
0059     echo "$0 already running.  Aborting process."
0060     exit 50
0061 else
0062     touch o2o-setIOV.lock
0063 fi
0064 
0065 # Delete semaphore and exit if any signal is trapped
0066 # KILL signal (9) is not trapped even though it is listed below.
0067 trap "rm -f o2o-setIOV.lock; mv tmp.log tmp.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
0068 
0069 # run script; args are run key
0070 rm -f tmp.log
0071 echo "`date` : setting TSC IOVs" >& tmp.log
0072 $CMSSW_BASE/src/CondTools/L1Trigger/scripts/runL1-O2O-iov.sh -x ${centralRel} ${run} ${key} >> tmp.log 2>&1
0073 o2ocode1=$?
0074 
0075 o2ocode2=0
0076 if [ ${nflag} -eq 0 ]
0077     then
0078     echo "`date` : setting RS keys and IOVs" >> tmp.log 2>&1
0079     if [ ${oflag} -eq 0 ]
0080         then
0081         $CMSSW_BASE/src/CondTools/L1Trigger/scripts/runL1-O2O-rs.sh -x ${centralRel} ${run} >> tmp.log 2>&1
0082         o2ocode2=$?
0083     else
0084         $CMSSW_BASE/src/CondTools/L1Trigger/scripts/runL1-O2O-rs.sh -x -o ${centralRel} ${run} >> tmp.log 2>&1
0085         o2ocode2=$?
0086     fi
0087 fi
0088 
0089 cat tmp.log | tee -a /nfshome0/popcondev/L1Job/o2o-setIOV-${version}.log
0090 #cat tmp.log >> /nfshome0/popcondev/L1Job/o2o-setIOV-${version}.log 2>&1 # use w/o ssh
0091 #cat tmp.log # causes timeout
0092 
0093 # log TSC key and RS keys
0094 echo "runNumber=${run} tscKey=${key}" >> /nfshome0/popcondev/L1Job/keylogs/tsckeys.txt
0095 
0096 if [ ${nflag} -eq 0 ]
0097     then
0098     grep KEYLOG tmp.log | sed 's/KEYLOG //' >> /nfshome0/popcondev/L1Job/keylogs/rskeys.txt
0099 fi
0100 
0101 rm -f tmp.log
0102 
0103 echo "cmsRun status (TSC) ${o2ocode1}" | tee -a /nfshome0/popcondev/L1Job/o2o-setIOV-${version}.log
0104 echo "cmsRun status (RS) ${o2ocode2}" | tee -a /nfshome0/popcondev/L1Job/o2o-setIOV-${version}.log
0105 o2ocode=`echo ${o2ocode1} + ${o2ocode2} | bc`
0106 echo "exit code ${o2ocode}" | tee -a /nfshome0/popcondev/L1Job/o2o-setIOV-${version}.log
0107 
0108 if [ ${o2ocode} -eq 0 ]
0109     then
0110     echo "L1-O2O-INFO: o2o-setIOV.sh successful"
0111 else
0112     echo "L1-O2O-ERROR: o2o-setIOV.sh failed!" >&2
0113 fi
0114 
0115 echo "`date` : o2o-setIOV-slc5.sh finished : ${run} ${key}" | tee -a /nfshome0/popcondev/L1Job/o2o-setIOV-${version}.log
0116 echo "" | tee -a /nfshome0/popcondev/L1Job/o2o-setIOV-${version}.log
0117 
0118 #if [ ! -f /nfshome0/popcondev/L1Job/o2o.summary ]
0119 #    then
0120 #    touch /nfshome0/popcondev/L1Job/o2o.summary
0121 #fi
0122 tail -5 /nfshome0/popcondev/L1Job/o2o-setIOV-${version}.log >> /nfshome0/popcondev/L1Job/o2o.summary
0123 
0124 # Delete semaphore file
0125 rm -f o2o-setIOV.lock
0126 
0127 exit ${o2ocode}