File indexing completed on 2024-05-31 04:19:32
0001
0002 SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
0003
0004 function diewrite { echo Failure $1: status $2 ; echo "" ; echo "----- Error -----"; echo ""; cat out_2_write.log; rm -rf $3/{ramdisk,data,*.py}; exit $2 ; }
0005 function dieread { echo Failure $1: status $2 ; echo "" ; echo "----- Error -----"; echo ""; cat out_2_read.log; rm -rf $3/{ramdisk,data,*.py}; exit $2 ; }
0006 function diemerge { echo Failure $1: status $2 ; echo "" ; echo "----- Error -----"; echo ""; cat out_2_merge.log; rm -rf $3/{ramdisk,data,*.py}; exit $2 ; }
0007
0008
0009
0010 if [ -z ${SCRAM_TEST_PATH} ]; then
0011 SCRAM_TEST_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
0012 fi
0013 echo "SCRAM_TEST_PATH = ${SCRAM_TEST_PATH}"
0014
0015 RC=0
0016 P=$$
0017 PREFIX=results_${USER}${P}
0018 OUTDIR=${PWD}/${PREFIX}
0019
0020 echo "OUT_TMP_DIR = $OUTDIR"
0021
0022 mkdir ${OUTDIR}
0023 cp ${SCRIPTDIR}/writeStreamerFile_cfg.py ${OUTDIR}
0024 cp ${SCRIPTDIR}/readStreamerFile_cfg.py ${OUTDIR}
0025 cp ${SCRIPTDIR}/mergeStreamerFile_cfg.py ${OUTDIR}
0026 cd ${OUTDIR}
0027
0028 rm -rf $OUTDIR/{ramdisk,data,*.log}
0029
0030 runnumber="100101"
0031
0032
0033 echo "Running test on reading single file"
0034 CMDLINE_WRITE="cmsRun writeStreamerFile_cfg.py --numEvents=10 --runNumber=${runnumber}"
0035 ${CMDLINE_WRITE} > out_2_write.log 2>&1 || diewrite "${CMDLINE_WRITE}" $? $OUTDIR
0036
0037
0038 ls -1 data/run${runnumber}/run${runnumber}_ls0000_streamA_pid*.ini | head -1 | xargs cat > test.dat
0039 cat data/run${runnumber}/run${runnumber}_ls0001_streamA_pid*.dat >> test.dat
0040
0041 CMDLINE_READ="cmsRun readStreamerFile_cfg.py --input test.dat --runNumber=${runnumber} --numEvents=10"
0042 ${CMDLINE_READ} > out_2_read.log 2>&1 || dieread "${CMDLINE_READ}" $? $OUTDIR
0043
0044 rm -rf data
0045
0046 echo "Running test on reading two separate files"
0047
0048 CMDLINE_WRITE="cmsRun writeStreamerFile_cfg.py --numEvents=10 --runNumber=${runnumber}"
0049 ${CMDLINE_WRITE} > out_2_write.log 2>&1 || diewrite "${CMDLINE_WRITE}" $? $OUTDIR
0050
0051
0052 ls -1 data/run${runnumber}/run${runnumber}_ls0000_streamA_pid*.ini | head -1 | xargs cat > test1.dat
0053 cat data/run${runnumber}/run${runnumber}_ls0001_streamA_pid*.dat >> test1.dat
0054
0055 rm -rf data
0056
0057 CMDLINE_WRITE="cmsRun writeStreamerFile_cfg.py --numEvents=10 --startEvent=11 --runNumber=${runnumber}"
0058 ${CMDLINE_WRITE} > out_2_write.log 2>&1 || diewrite "${CMDLINE_WRITE}" $? $OUTDIR
0059
0060
0061 ls -1 data/run${runnumber}/run${runnumber}_ls0000_streamA_pid*.ini | head -1 | xargs cat > test2.dat
0062 cat data/run${runnumber}/run${runnumber}_ls0001_streamA_pid*.dat >> test2.dat
0063
0064 CMDLINE_READ="cmsRun readStreamerFile_cfg.py --input test1.dat --input test2.dat --runNumber=${runnumber} --numEvents=20"
0065 ${CMDLINE_READ} > out_2_read.log 2>&1 || dieread "${CMDLINE_READ}" $? $OUTDIR
0066
0067 rm -rf data
0068
0069 echo "Running test on reading two separate files with different BranchIDLists"
0070
0071 CMDLINE_WRITE="cmsRun writeStreamerFile_cfg.py --numEvents=10 --runNumber=${runnumber}"
0072 ${CMDLINE_WRITE} > out_2_write.log 2>&1 || diewrite "${CMDLINE_WRITE}" $? $OUTDIR
0073
0074
0075 ls -1 data/run${runnumber}/run${runnumber}_ls0000_streamA_pid*.ini | head -1 | xargs cat > test1.dat
0076 cat data/run${runnumber}/run${runnumber}_ls0001_streamA_pid*.dat >> test1.dat
0077
0078 rm -rf data
0079
0080 CMDLINE_WRITE="cmsRun writeStreamerFile_cfg.py --numEvents=10 --startEvent=11 --runNumber=${runnumber} --changeBranchIDLists T"
0081 ${CMDLINE_WRITE} > out_2_write.log 2>&1 || diewrite "${CMDLINE_WRITE}" $? $OUTDIR
0082
0083
0084 ls -1 data/run${runnumber}/run${runnumber}_ls0000_streamA_pid*.ini | head -1 | xargs cat > test2.dat
0085 cat data/run${runnumber}/run${runnumber}_ls0001_streamA_pid*.dat >> test2.dat
0086
0087 CMDLINE_READ="cmsRun readStreamerFile_cfg.py --input test1.dat --input test2.dat --runNumber=${runnumber} --numEvents=20"
0088 ${CMDLINE_READ} > out_2_read.log 2>&1 || dieread "${CMDLINE_READ}" $? $OUTDIR
0089
0090 rm -rf data
0091
0092
0093 echo "Running test one concatenated file"
0094
0095 CMDLINE_WRITE="cmsRun writeStreamerFile_cfg.py --numEvents=10 --runNumber=${runnumber}"
0096 ${CMDLINE_WRITE} > out_2_write.log 2>&1 || diewrite "${CMDLINE_WRITE}" $? $OUTDIR
0097
0098 CMDLINE_WRITE="cmsRun writeStreamerFile_cfg.py --numEvents=10 --startEvent=11 --runNumber=${runnumber}"
0099 ${CMDLINE_WRITE} > out_2_write.log 2>&1 || diewrite "${CMDLINE_WRITE}" $? $OUTDIR
0100
0101
0102 ls -1 data/run${runnumber}/run${runnumber}_ls0000_streamA_pid*.ini | head -1 | xargs cat > test.dat
0103 cat data/run${runnumber}/run${runnumber}_ls0001_streamA_pid*.dat >> test.dat
0104
0105 CMDLINE_READ="cmsRun readStreamerFile_cfg.py --input test.dat --runNumber=${runnumber} --numEvents=20"
0106 ${CMDLINE_READ} > out_2_read.log 2>&1 || dieread "${CMDLINE_READ}" $? $OUTDIR
0107
0108
0109 rm -rf data
0110
0111 echo "Running test on concatenated file from jobs with different BranchIDLists"
0112
0113 CMDLINE_WRITE="cmsRun writeStreamerFile_cfg.py --numEvents=10 --runNumber=${runnumber}"
0114 ${CMDLINE_WRITE} > out_2_write.log 2>&1 || diewrite "${CMDLINE_WRITE}" $? $OUTDIR
0115
0116 CMDLINE_WRITE="cmsRun writeStreamerFile_cfg.py --numEvents=10 --startEvent=11 --runNumber=${runnumber} --changeBranchIDLists T"
0117 ${CMDLINE_WRITE} > out_2_write.log 2>&1 || diewrite "${CMDLINE_WRITE}" $? $OUTDIR
0118
0119
0120 ls -1 data/run${runnumber}/run${runnumber}_ls0000_streamA_pid*.ini | head -1 | xargs cat > test.dat
0121 cat data/run${runnumber}/run${runnumber}_ls0001_streamA_pid*.dat >> test.dat
0122
0123 CMDLINE_READ="cmsRun readStreamerFile_cfg.py --input test.dat --runNumber=${runnumber} --numEvents=20"
0124 ${CMDLINE_READ} > out_2_read.log 2>&1 || dieread "${CMDLINE_READ}" $? $OUTDIR
0125
0126
0127 rm -rf data
0128
0129
0130 echo "Test merging streamers using cmsRun"
0131
0132 CMDLINE_WRITE="cmsRun writeStreamerFile_cfg.py --numEvents=10 --runNumber=${runnumber}"
0133 ${CMDLINE_WRITE} > out_2_write.log 2>&1 || diewrite "${CMDLINE_WRITE}" $? $OUTDIR
0134
0135
0136 ls -1 data/run${runnumber}/run${runnumber}_ls0000_streamA_pid*.ini | head -1 | xargs cat > test1.dat
0137 cat data/run${runnumber}/run${runnumber}_ls0001_streamA_pid*.dat >> test1.dat
0138
0139 rm -rf data
0140
0141 CMDLINE_WRITE="cmsRun writeStreamerFile_cfg.py --numEvents=10 --startEvent=11 --runNumber=${runnumber}"
0142 ${CMDLINE_WRITE} > out_2_write.log 2>&1 || diewrite "${CMDLINE_WRITE}" $? $OUTDIR
0143
0144
0145 ls -1 data/run${runnumber}/run${runnumber}_ls0000_streamA_pid*.ini | head -1 | xargs cat > test2.dat
0146 cat data/run${runnumber}/run${runnumber}_ls0001_streamA_pid*.dat >> test2.dat
0147
0148 rm -rf data
0149
0150
0151 CMDLINE_MERGE="cmsRun mergeStreamerFile_cfg.py --input test1.dat --input test2.dat --runNumber=${runnumber}"
0152 ${CMDLINE_MERGE} > out_2_merge.log 2>&1 || diemerge "${CMDLINE_MERGE}" $? $OUTDIR
0153
0154
0155 ls -1 data/run${runnumber}/run${runnumber}_ls0000_merge_pid*.ini | head -1 | xargs cat > test.dat
0156 cat data/run${runnumber}/run${runnumber}_ls0001_merge_pid*.dat >> test.dat
0157
0158
0159 CMDLINE_READ="cmsRun readStreamerFile_cfg.py --input test.dat --runNumber=${runnumber} --numEvents=20"
0160 ${CMDLINE_READ} > out_2_read.log 2>&1 || dieread "${CMDLINE_READ}" $? $OUTDIR
0161
0162 rm -rf data
0163
0164 echo "Test merging files with different BranchIDLists"
0165
0166 CMDLINE_WRITE="cmsRun writeStreamerFile_cfg.py --numEvents=10 --runNumber=${runnumber}"
0167 ${CMDLINE_WRITE} > out_2_write.log 2>&1 || diewrite "${CMDLINE_WRITE}" $? $OUTDIR
0168
0169
0170 ls -1 data/run${runnumber}/run${runnumber}_ls0000_streamA_pid*.ini | head -1 | xargs cat > test1.dat
0171 cat data/run${runnumber}/run${runnumber}_ls0001_streamA_pid*.dat >> test1.dat
0172
0173 rm -rf data
0174
0175 CMDLINE_WRITE="cmsRun writeStreamerFile_cfg.py --numEvents=10 --startEvent=11 --runNumber=${runnumber} --changeBranchIDLists T"
0176 ${CMDLINE_WRITE} > out_2_write.log 2>&1 || diewrite "${CMDLINE_WRITE}" $? $OUTDIR
0177
0178
0179 ls -1 data/run${runnumber}/run${runnumber}_ls0000_streamA_pid*.ini | head -1 | xargs cat > test2.dat
0180 cat data/run${runnumber}/run${runnumber}_ls0001_streamA_pid*.dat >> test2.dat
0181
0182 rm -rf data
0183
0184 CMDLINE_MERGE="cmsRun mergeStreamerFile_cfg.py --input test1.dat --input test2.dat --runNumber=${runnumber}"
0185 ${CMDLINE_MERGE} > out_2_merge.log 2>&1 || diemerge "${CMDLINE_MERGE}" $? $OUTDIR
0186
0187
0188 ls -1 data/run${runnumber}/run${runnumber}_ls0000_merge_pid*.ini | head -1 | xargs cat > test.dat
0189 cat data/run${runnumber}/run${runnumber}_ls0001_merge_pid*.dat >> test.dat
0190
0191 CMDLINE_READ="cmsRun readStreamerFile_cfg.py --input test.dat --runNumber=${runnumber} --numEvents=20"
0192 ${CMDLINE_READ} > out_2_read.log 2>&1 || dieread "${CMDLINE_READ}" $? $OUTDIR
0193
0194
0195
0196 echo "Running test on reading single empty file"
0197 CMDLINE_WRITE="cmsRun writeStreamerFile_cfg.py --numEvents=0 --runNumber=${runnumber}"
0198 ${CMDLINE_WRITE} > out_2_write.log 2>&1 || diewrite "${CMDLINE_WRITE}" $? $OUTDIR
0199
0200
0201 ls -1 data/run${runnumber}/run${runnumber}_ls0000_streamA_pid*.ini | head -1 | xargs cat > test.dat
0202 cat data/run${runnumber}/run${runnumber}_ls0001_streamA_pid*.dat >> test.dat
0203
0204 CMDLINE_READ="cmsRun readStreamerFile_cfg.py --input test.dat --runNumber=${runnumber} --numEvents=0"
0205 ${CMDLINE_READ} > out_2_read.log 2>&1 || dieread "${CMDLINE_READ}" $? $OUTDIR
0206
0207 rm -rf data
0208
0209 echo "Running test on reading two separate empty files"
0210
0211 CMDLINE_WRITE="cmsRun writeStreamerFile_cfg.py --numEvents=10 --runNumber=${runnumber} --numEvents=0"
0212 ${CMDLINE_WRITE} > out_2_write.log 2>&1 || diewrite "${CMDLINE_WRITE}" $? $OUTDIR
0213
0214
0215 ls -1 data/run${runnumber}/run${runnumber}_ls0000_streamA_pid*.ini | head -1 | xargs cat > test1.dat
0216 cat data/run${runnumber}/run${runnumber}_ls0001_streamA_pid*.dat >> test1.dat
0217
0218 rm -rf data
0219
0220 CMDLINE_WRITE="cmsRun writeStreamerFile_cfg.py --numEvents=10 --startEvent=11 --runNumber=${runnumber} --numEvents=0"
0221 ${CMDLINE_WRITE} > out_2_write.log 2>&1 || diewrite "${CMDLINE_WRITE}" $? $OUTDIR
0222
0223
0224 ls -1 data/run${runnumber}/run${runnumber}_ls0000_streamA_pid*.ini | head -1 | xargs cat > test2.dat
0225 cat data/run${runnumber}/run${runnumber}_ls0001_streamA_pid*.dat >> test2.dat
0226
0227 CMDLINE_READ="cmsRun readStreamerFile_cfg.py --input test1.dat --input test2.dat --runNumber=${runnumber} --numEvents=0"
0228 ${CMDLINE_READ} > out_2_read.log 2>&1 || dieread "${CMDLINE_READ}" $? $OUTDIR
0229
0230 rm -rf data
0231
0232
0233 echo "Running test one concatenated empty file"
0234
0235 CMDLINE_WRITE="cmsRun writeStreamerFile_cfg.py --numEvents=0 --runNumber=${runnumber}"
0236 ${CMDLINE_WRITE} > out_2_write.log 2>&1 || diewrite "${CMDLINE_WRITE}" $? $OUTDIR
0237
0238 CMDLINE_WRITE="cmsRun writeStreamerFile_cfg.py --numEvents=0 --startEvent=11 --runNumber=${runnumber}"
0239 ${CMDLINE_WRITE} > out_2_write.log 2>&1 || diewrite "${CMDLINE_WRITE}" $? $OUTDIR
0240
0241
0242 ls -1 data/run${runnumber}/run${runnumber}_ls0000_streamA_pid*.ini | head -1 | xargs cat > test.dat
0243 cat data/run${runnumber}/run${runnumber}_ls0001_streamA_pid*.dat >> test.dat
0244
0245 CMDLINE_READ="cmsRun readStreamerFile_cfg.py --input test.dat --runNumber=${runnumber} --numEvents=0"
0246 ${CMDLINE_READ} > out_2_read.log 2>&1 || dieread "${CMDLINE_READ}" $? $OUTDIR
0247
0248
0249 rm -rf data
0250
0251
0252
0253 echo "Completed sucessfully"
0254
0255 rm -rf $OUTDIR
0256
0257 exit ${RC}
0258