File indexing completed on 2024-04-06 11:57:28
0001
0002
0003
0004
0005
0006 source /afs/cern.ch/cms/caf/setup.sh
0007 curdir="$(pwd)"
0008
0009 workdir="<MYCMSSW>"
0010 dqmdir="MICKEY"
0011
0012 if [ $
0013 then
0014 dqmdir="$3"
0015 else
0016 dqmdir="${curdir}/MONITORING/DQM/"
0017 fi
0018
0019
0020
0021 echo Setting up CMSSW environment in $workdir
0022 cd $workdir
0023 eval `scramv1 runtime -sh`
0024
0025 cd $curdir
0026
0027
0028 rfcp $1 /castor/cern.ch/cms/$2/logfiles/
0029 BASE_JOBNAME=$(basename "$1" .py)
0030 LOGFILE="${BASE_JOBNAME}.log"
0031 OUTFILE="${BASE_JOBNAME}.out"
0032 echo "Running the prescaling in $curdir..."
0033 echo "Logfile in $LOGFILE"
0034
0035
0036 time cmsRun $1 &> $LOGFILE
0037 echo ""
0038 echo "---------"
0039 echo "File list in $(pwd): "
0040 ls -lh
0041 echo "---------"
0042 echo ""
0043 echo ""
0044 echo "Copying to /castor/cern.ch/cms/$2"
0045
0046
0047
0048 STATUScp=0
0049 for outROOT in $( ls ALCA*resc*.root )
0050 do
0051 cmsStageOut $outROOT "$2/"
0052
0053 if [ $? -ne 0 ]
0054 then
0055 echo "Error in copying the .root file to CASTOR !"
0056 fi
0057 let STATUScp=$STATUScp+$?
0058 done
0059 echo "Copying to /castor/cern.ch/cms/$2/logfiles/"
0060 STATUScp=0
0061 for outLOG in $( ls *.out )
0062 do
0063 cp $outLOG "${dqmdir}/../logfiles/"
0064 let STATUScp=$STATUScp+$?
0065 cmsStageOut $outLOG "$2/"
0066 let STATUScp=$STATUScp+$?
0067 done
0068
0069 for outLOG in $( ls *.log )
0070 do
0071 cmsStageOut $outLOG "$2/"
0072 let STATUScp=$STATUScp+$?
0073 cp $outLOG "${dqmdir}/../logfiles/"
0074 let STATUScp=$STATUScp+$?
0075
0076 if [ $STATUcp -ne 0 ]
0077 then
0078 echo "Error in copying the .log file to CASTOR !"
0079 fi
0080 done
0081
0082
0083
0084
0085 if [ $STATUScp -ne 0 ]
0086 then
0087 echo "Error in copying the logfiles (status=${STATUScp})! Parallel job $1" > tmpmess.txt
0088 echo >> tmpmess.txt
0089 echo >> tmpmess.txt
0090 cat tmpmess.txt | mail -s "--- ERROR in copying files during ALCAPrescale! ---" ${USER}@mail.cern.ch
0091 fi
0092
0093
0094
0095 rm -f *.root
0096 rm -f *.log
0097 rm -f *.out
0098
0099 for logfile in $( ls ${curdir}/MONITORING/logfiles/*.log )
0100 do
0101 gzip $logfile
0102 rm -f $logfile
0103 done