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 - store TSC key
0004 
0005 oflag=0
0006 pflag=0
0007 while getopts 'oph' OPTION
0008   do
0009   case $OPTION in
0010       o) oflag=1
0011           ;;
0012       p) pflag=1
0013           ;;
0014       h) echo "Usage: [-o] tsckey"
0015           echo "  -o: overwrite keys"
0016           echo "  -p: centrally installed release, not on local machine"
0017           exit
0018           ;;
0019   esac
0020 done
0021 shift $(($OPTIND - 1))
0022 
0023 # get argument
0024 key=$1
0025 
0026 release=CMSSW_4_2_3_ONLINE
0027 version=011
0028 
0029 echo "`date` : o2o-tscKey-slc5.sh $key" | tee -a /nfshome0/popcondev/L1Job/o2o-tscKey-${version}.log
0030 
0031 echo "whoami: `whoami`" | tee -a /nfshome0/popcondev/L1Job/o2o-tscKey-${version}.log
0032 
0033 if [ $# -lt 1 ]
0034     then
0035     echo "Wrong number of arguments.  Usage: $0 tsckey" | tee -a /nfshome0/popcondev/L1Job/o2o-tscKey-${version}.log
0036     exit 127
0037 fi
0038 
0039 # set up environment variables
0040 cd /cmsnfshome0/nfshome0/popcondev/L1Job/${release}/o2o
0041 
0042 if [ ${pflag} -eq 0 ]
0043     then
0044     export SCRAM_ARCH=""
0045     export VO_CMS_SW_DIR=""
0046     source /opt/cmssw/cmsset_default.sh
0047 else
0048     source /nfshome0/cmssw2/scripts/setup.sh
0049     centralRel="-p"
0050 fi
0051 eval `scramv1 run -sh`
0052 
0053 # Check for semaphore file
0054 if [ -f o2o-tscKey.lock ]
0055     then
0056     echo "$0 already running.  Aborting process." | tee -a /nfshome0/popcondev/L1Job/o2o-tscKey-${version}.log
0057     echo "$0 already running.  Aborting process." 1>&2
0058     exit 50
0059 else
0060     touch o2o-tscKey.lock
0061 fi
0062 
0063 # Delete semaphore and exit if any signal is trapped
0064 # KILL signal (9) is not trapped even though it is listed below.
0065 trap "rm -f o2o-tscKey.lock; mv tmpb.log tmpb.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
0066 
0067 # run script; args are key records
0068 rm -f tmpb.log
0069 
0070 # Check if o2o-setIOV.sh is running.  If so, wait 15 seconds to prevent simultaneous writing ot ORCON.
0071 if [ -f o2o-setIOV.lock ]
0072     then
0073     echo "o2o-setIOV.sh currently running.  Wait 15 seconds...." >> tmpb.log 2>&1
0074     sleep 15
0075     echo "Resuming process." >> tmpb.log 2>&1
0076 fi
0077 
0078 if [ ${oflag} -eq 0 ]
0079     then
0080     $CMSSW_BASE/src/CondTools/L1Trigger/scripts/runL1-O2O-key.sh -x ${centralRel} ${key} >& tmpb.log
0081     o2ocode=$?
0082 else
0083     $CMSSW_BASE/src/CondTools/L1Trigger/scripts/runL1-O2O-key.sh -x -o ${centralRel} ${key} >& tmpb.log
0084     o2ocode=$?
0085 fi
0086 
0087 cat tmpb.log | tee -a /nfshome0/popcondev/L1Job/o2o-tscKey-${version}.log
0088 rm -f tmpb.log
0089 
0090 echo "cmsRun status ${o2ocode}" | tee -a /nfshome0/popcondev/L1Job/o2o-tscKey-${version}.log
0091 
0092 if [ ${o2ocode} -eq 0 ]
0093     then
0094     echo "L1-O2O-INFO: o2o-tscKey.sh successful"
0095 else
0096     if [ ${o2ocode} -eq 90 ]
0097         then
0098         echo "L1-O2O-ERROR: problem with Oracle databases."
0099         echo "L1-O2O-ERROR: problem with Oracle databases." 1>&2
0100     else
0101         echo "L1-O2O-ERROR: o2o-tscKey.sh failed!"
0102         echo "L1-O2O-ERROR: o2o-tscKey.sh failed!" 1>&2
0103     fi
0104 fi
0105 
0106 echo "`date` : o2o-tscKey-slc5.sh finished : ${key}" | tee -a /nfshome0/popcondev/L1Job/o2o-tscKey-${version}.log
0107 echo "" | tee -a /nfshome0/popcondev/L1Job/o2o-tscKey-${version}.log
0108 
0109 #if [ ! -f /nfshome0/popcondev/L1Job/o2o.summary ]
0110 #    then
0111 #    touch /nfshome0/popcondev/L1Job/o2o.summary
0112 #fi
0113 tail -4 /nfshome0/popcondev/L1Job/o2o-tscKey-${version}.log >> /nfshome0/popcondev/L1Job/o2o.summary
0114 
0115 # Delete semaphore file
0116 rm -f o2o-tscKey.lock
0117 
0118 exit ${o2ocode}