- Timestamp:
- 07/02/10 12:54:37 (14 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r9604 r9605 19 19 -*-*- END OF LINE -*-*- 20 20 21 2010/07/02 Daniela Dorner 22 23 * datacenter/scripts/runcorsika: 24 - removed $com 25 - updated logging 26 27 * datacenter/scripts/runceres: 28 - fixed path 29 - added error handling 30 31 * resources/steps_fact.rc: 32 - update joins to new scheme to include further steps in the chain 33 34 * datacenter/scripts/sourcefile: 35 - adapted queries to new scheme of joins 36 37 * datacenter/scripts/runstar_mc: 38 - added (script to run star for mc) 39 40 41 42 2010/07/02 Daniela Dorner, Christian Farnier 43 44 * datacenter/scripts/runcallisto_mc: 45 - added (script to callibrate mc) 46 47 48 21 49 2010/06/30 Daniela Dorner 22 50 -
trunk/MagicSoft/Mars/datacenter/scripts/runceres
r9603 r9605 57 57 makedir $outpath 58 58 log=$outpath/ceres`printf %08d $run `"."`printf %06d $file | cut -c 4-6` 59 setupfile=$setuppath/ `printf %03d $cereskey`/ceres.rc59 setupfile=$setuppath/$program/`printf %03d $cereskey`/ceres.rc 60 60 61 61 query="SELECT fRunTypeKEY FROM CeresInfo WHERE fRunNumber="$run" AND fFileNumber="$file" AND fCeresSetupKEY="$cereskey … … 87 87 esac 88 88 89 case $check1 in 90 0) printprocesslog "INFO $program finished successfully for run $run file $file cereskey $cereskey runtype $runkey (check1=$check1)" 91 ;; 92 *) printprocesslog "ERROR $program failed for run $run file $file cereskey $cereskey runtype $runkey (check1=$check1)" 93 check=$check1 94 ;; 95 esac 89 96 90 97 setstatus "stop" -
trunk/MagicSoft/Mars/datacenter/scripts/runcorsika
r9603 r9605 206 206 check1=$? 207 207 case $check1 in 208 0) printprocesslog "INFO $program finished successfully for run $run file $file ( check1=$check1)"208 0) printprocesslog "INFO $program finished successfully for run $run file $file (return code $check1)" 209 209 ;; 210 *) printprocesslog "ERROR $program failed for run $run file $file (check1=$check1)" 211 com=$Fcorsika 210 *) printprocesslog "ERROR $program failed for run $run file $file (return code $check1)" 212 211 check=$check1 213 212 ;; -
trunk/MagicSoft/Mars/datacenter/scripts/sourcefile
r9604 r9605 254 254 255 255 # function to get the join of a step 256 # (normal join but using different primaries)257 256 # from the dependencies-file steps.rc 257 # $1 gives the step 258 # $2 gives the type of join 258 259 function getjoin() 259 260 { 260 261 getdbsetup 261 grep $@"[.]Join:" $steps | grep -v '#' | sed -e "s/$@[.]Join://" 262 } 263 264 # function to get the special join of a step 265 # (i.e. join with a different table) 266 # from the dependencies-file steps.rc 267 function getspecialjoin() 268 { 269 getdbsetup 270 grep $@"[.]SpecialJoin:" $steps | grep -v '#' | sed -e "s/$@[.]SpecialJoin://" 262 grep $1"[.]"$2"Join:" $steps | grep -v '#' | sed -e "s/$1[.]$2Join://" 271 263 } 272 264 … … 276 268 getdbsetup 277 269 grep $@"[.]Needs:" $steps | sed -e "s/$@[.]Needs://" 270 } 271 272 # subquery which is needed to check the 273 # status of the steps with different primaries 274 function subquerypart() 275 { 276 query=$query" SELECT COUNT(*) FROM "$need"Status " 277 query=$query" "`getjoin $need "SpecialInfluence"`" " 278 query=$query" WHERE "$step"Status."`echo ${prims[0]} | sed -e 's/,//g'`"="$step"Status."`echo ${prims[0]} | sed -e 's/,//g'` 279 for (( j=1 ; j < ${#prims[@]} ; j++ )) 280 do 281 query=$query" AND "$step"Status."`echo ${prims[$j]} | sed -e 's/,//g'`"="$step"Status."`echo ${prims[$j]} | sed -e 's/,//g'` 282 done 278 283 } 279 284 … … 289 294 needprims=( `getprimary $need` ) 290 295 # make sure that the correct joins are used 291 # in case the primaries of the step and the need are 292 # the same, the tables are join with these primaries 293 # otherwise it is checked whether there has to be a 294 # join with different primaries (indicated as 'Join' 295 # in the steps.rc 296 # 'SpecialJoins' do not have to be taken into account here 297 if [ "`echo ${needprims[@]}`" == "`echo ${prims[@]}`" ] 298 then 299 query=$query" LEFT JOIN "$need"Status USING (${prims[@]}) " 300 else 301 stdjoin=`getjoin $need` 302 if ! [ "$stdjoin" = "" ] 303 then 304 query=$query" "$stdjoin" " 305 fi 296 specialneedjoin=`getjoin $need "SpecialNeed"` 297 if [ "$specialneedjoin" = "" ] 298 then 299 query=$query" LEFT JOIN "$need"Status USING (${needprims[@]}) " 300 else 301 query=$query" "$specialneedjoin" " 302 query=$query" LEFT JOIN "$need"Status USING (${needprims[@]}) " 303 break 306 304 fi 307 305 done … … 310 308 # add condition for the status of the peceding steps 311 309 counter=0 310 specialneedjoin= 312 311 for need in $needs 313 312 do … … 316 315 query=$query" AND " 317 316 fi 318 needprims=( `getprimary $need` ) 319 # in case the primaries of the tables agree 320 # or there is just a normal 'Join' needed 321 # only the condition is added to the query 322 # for tables which need a join with a different 323 # table, a special query is added using the 324 # 'SpecialJoin' from the steps.rc 325 if [ "`echo ${needprims[@]}`" == "`echo ${prims[@]}`" ] || ! [ "$stdjoin" = "" ] 317 specialneedjoin=$specialneedjoin" "`getjoin $need "SpecialNeed"` 318 if [ "$specialneedjoin" = " " ] 326 319 then 320 # condition for step with same primaries 327 321 query=$query" NOT ISNULL("$need"Status.fStartTime) AND " 328 322 query=$query" NOT ISNULL("$need"Status.fStopTime) AND " 329 323 query=$query" ISNULL("$need"Status.fReturnCode) " 324 specialneedjoin= 330 325 else 331 query=$query" (SELECT COUNT(*) FROM "$need"Status " 332 query=$query" "`getspecialjoin $need`" " 333 query=$query" WHERE "$step"Status."`echo ${prims[0]} | sed -e 's/,//g'`"="$step"Status."`echo ${prims[0]} | sed -e 's/,//g'` 334 for (( j=1 ; j < ${#prims[@]} ; j++ )) 335 do 336 query=$query" AND "$step"Status."`echo ${prims[$j]} | sed -e 's/,//g'`"="$step"Status."`echo ${prims[$j]} | sed -e 's/,//g'` 337 done 338 query=$query") = (SELECT COUNT(*) FROM "$need"Status " 339 query=$query" "`getspecialjoin $need`" " 340 query=$query" WHERE "$step"Status."`echo ${prims[0]} | sed -e 's/,//g'`"="$step"Status."`echo ${prims[0]} | sed -e 's/,//g'` 341 for (( j=1 ; j < ${#prims[@]} ; j++ )) 342 do 343 query=$query" AND "$step"Status."`echo ${prims[$j]} | sed -e 's/,//g'`"="$step"Status."`echo ${prims[$j]} | sed -e 's/,//g'` 344 done 326 # special query to check steps which 327 # do not have the same primaries 328 # comparison of 329 # number of rows 330 # with 331 # number of rows which are done 332 query=$query" ( " 333 subquerypart 334 query=$query" ) = ( " 335 subquerypart 345 336 query=$query" AND NOT ISNULL(fStartTime) " 346 337 query=$query" AND NOT ISNULL(fStopTime) " … … 500 491 query=" UPDATE "$step"Status " 501 492 # add joins to the influenced tables 502 stepspecialjoin="" 493 specialinfljoin=`getjoin $step "SpecialInfluence"` 494 if ! [ "$specialinfljoin" = "" ] 495 then 496 query=$query" "$specialinfljoin 497 fi 503 498 for influence in $influences 504 499 do 505 inflprims=( `getprimary $influence` ) 506 # make sure that the correct joins are used 507 # in case the primaries of the step and the influence are 508 # the same, the tables are join with these primaries 509 # otherwise they are joined with the primaries of the influence 510 if [ "`echo ${inflprims[@]}`" == "`echo ${prims[@]}`" ] 511 then 512 query=$query" LEFT JOIN "$influence"Status USING (${prims[@]}) " 500 infljoin=`getjoin $influence "Influence"` 501 if [ "$infljoin" = "" ] 502 then 503 inflprims=( `getprimary $influence` ) 504 query=$query" LEFT JOIN "$influence"Status USING (${inflprims[@]}) " 513 505 else 514 prims2=`getprimary $step | sed -e "s/\ //g"` 515 primstest=`echo ${inflprims[@]} | sed -e "s/\ //g" | sed -e "s/$prims2//g"` 516 if [ "$primstest" == "`echo ${inflprims[@]} | sed -e "s/\ //g"`" ] 517 then 518 if [ "$stepspecialjoin" == "" ] 519 then 520 stepspecialjoin=`getspecialjoin $step` 521 query=$query" "$stepspecialjoin" " 522 fi 523 query=$query" LEFT JOIN "$influence"Status USING (${inflprims[@]}) " 524 else 525 infljoin=`getjoin $influence` 526 if [ "$infljoin" = "" ] 527 then 528 query=$query" LEFT JOIN "$influence"Status USING (${prims[@]}) " 529 else 530 query=$query" "$infljoin 531 # warning: this is a workaround 532 # it has to be checked whether it works for all steps 533 stepspecialjoin="not empty" 534 fi 535 fi 506 query=$query" "$infljoin 536 507 fi 537 508 done -
trunk/MagicSoft/Mars/resources/steps_fact.rc
r9604 r9605 1 1 2 2 Corsika.Primaries: fRunNumber, fFileNumber 3 Corsika.SpecialJoin: LEFT JOIN CeresInfo USING(fRunNumber, fFileNumber)4 Corsika.Join: LEFT JOIN CorsikaStatus USING(fRunNumber, fFileNumber)5 3 6 4 Ceres.Primaries: fRunNumber, fFileNumber, fCeresSetupKEY 7 Ceres.SpecialJoin: LEFT JOIN CeresInfo USING(fRunNumber, fFileNumber, fCeresSetupKEY) 8 Ceres.Join: LEFT JOIN CeresStatus USING(fRunNumber, fFileNumber) LEFT JOIN CeresInfo USING(fRunNumber, fFileNumber, fCeresSetupKEY) 9 Ceres.Needs: Corsika 5 Ceres.SpecialNeedJoin: LEFT JOIN CeresInfo USING(fSequenceNumber, fCeresSetupKEY) 6 Ceres.SpecialInfluenceJoin: LEFT JOIN CeresInfo USING(fRunNumber, fFileNumber, fCeresSetupKEY) 7 Ceres.NeedJoin: fSequenceNumber, fCeresSetupKEY 8 Ceres.InfluenceJoin: fRunNumber, fFileNumber 10 9 11 10 SequenceFile.Primaries: fSequenceNumber 12 SequenceFile.Join: LEFT JOIN SequenceFileStatus USING(fSequenceNumber)13 11 14 12 Callisto.Primaries: fSequenceNumber, fCeresSetupKEY 15 Callisto.Needs: Corsika Ceres SequenceFile13 Callisto.Needs: SequenceFile Ceres Corsika 16 14 17 15 Star.Primaries: fSequenceNumber, fCeresSetupKEY 18 Star.Needs: C orsika Ceres SequenceFile Callisto16 Star.Needs: Callisto SequenceFile Ceres Corsika 19 17 20 21
Note:
See TracChangeset
for help on using the changeset viewer.