Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:50:48

0001 #!/bin/sh
0002 
0003 # deployment-specific params
0004 BASEDIR=/data/O2O
0005 RELEASE=CMSSW_10_0_5
0006 ARCH=slc7_amd64_gcc630
0007 RELEASEDIR=/opt/offline/${ARCH}/cms/cmssw/${RELEASE}
0008 
0009 # command params
0010 OPTIND=1
0011 
0012 SUBSYS=""
0013 JOBNAME=""
0014 
0015 while getopts "h?s:j:" opt; do
0016     case $opt in
0017     h|\?)
0018         echo "Mo' to spiego..."
0019         exit 0
0020         ;;
0021     s)  SUBSYS=$OPTARG
0022         ;;
0023     j)  JOBNAME=$OPTARG
0024         ;;
0025     esac
0026 done
0027 
0028 shift $((OPTIND-1))
0029 
0030 [ "$1" = "--" ] && shift
0031 
0032 O2ONAME=$SUBSYS$JOBNAME
0033 #echo "name=$O2ONAME, subsystem=$SUBSYS, job=$JOBNAME"
0034 
0035 # o2o specific params
0036 LOGFILE=${BASEDIR}/logs/$O2ONAME.log
0037 JOBDIR=${BASEDIR}/${SUBSYS}/${JOBNAME}
0038 DATE=`date`
0039 
0040 # functions
0041 function logRun(){
0042     echo "----- new job started for $1 at -----" | tee -a $LOGFILE
0043     echo $DATE | tee -a $LOGFILE
0044 }
0045 
0046 function log() {
0047     echo "[`date`] : $@ " | tee -a $LOGFILE
0048 }
0049 
0050 function submit_command() {
0051     logRun $1
0052     o2o run -n $1 "$2" | tee -a $LOGFILE
0053 }
0054 
0055 function submit_test_command() {
0056     logRun $1
0057     o2o --db dev run -n $1 "$2" | tee -a $LOGFILE
0058 }
0059 
0060 function submit_cmsRun() {
0061     COMMAND="cmsRun $2 destinationDatabase={db} destinationTag={tag}"
0062     logRun $1
0063     o2o run -n $1 "$COMMAND" | tee -a $LOGFILE
0064 }
0065 
0066 function submit_test_cmsRun() {
0067     COMMAND="cmsRun $2 destinationDatabase={db} destinationTag={tag}"
0068     logRun $1
0069     o2o --db dev run -n $1 "$COMMAND" | tee -a $LOGFILE
0070 }
0071 
0072 function submit_popCon() {
0073     COMMAND="popconRun $2 -d {db} -t {tag} -c"
0074     logRun $1
0075     o2o run -n $1 "$COMMAND"  | tee -a $LOGFILE
0076 }
0077 
0078 function submit_test_popCon() {
0079     COMMAND="popconRun $2 -d {db} -t {tag} -c"
0080     logRun $1
0081     o2o --db dev run -n $1 "$COMMAND"  | tee -a $LOGFILE
0082 }
0083 
0084 # global variables
0085 export SCRAM_ARCH=$ARCH
0086 export O2O_LOG_FOLDER=/data/O2O/logs/${O2ONAME}
0087 export COND_AUTH_PATH=$BASEDIR
0088 source /opt/offline/cmsset_default.sh
0089 
0090 cd ${RELEASEDIR}/src
0091 eval `scramv1  run -sh`
0092 # set up OCCI workaround
0093 export LD_PRELOAD=$CMS_ORACLEOCCI_LIB
0094 
0095 # workaround for oracle tnsnames
0096 export TNS_ADMIN=/data/ext/oracle-env/29/etc
0097 
0098 cd ${JOBDIR}
0099 
0100