Changeset 9605 for trunk/MagicSoft


Ignore:
Timestamp:
07/02/10 12:54:37 (14 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r9604 r9605  
    1919                                                 -*-*- END OF LINE -*-*-
    2020
     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
    2149 2010/06/30 Daniela Dorner
    2250
  • trunk/MagicSoft/Mars/datacenter/scripts/runceres

    r9603 r9605  
    5757makedir $outpath
    5858log=$outpath/ceres`printf %08d $run `"."`printf %06d $file | cut -c 4-6`
    59 setupfile=$setuppath/`printf %03d $cereskey`/ceres.rc
     59setupfile=$setuppath/$program/`printf %03d $cereskey`/ceres.rc
    6060
    6161query="SELECT fRunTypeKEY FROM CeresInfo WHERE fRunNumber="$run" AND fFileNumber="$file" AND fCeresSetupKEY="$cereskey
     
    8787esac
    8888
     89case $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        ;;
     95esac
    8996
    9097setstatus "stop"
  • trunk/MagicSoft/Mars/datacenter/scripts/runcorsika

    r9603 r9605  
    206206check1=$?
    207207case $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)"
    209209        ;;
    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)"
    212211        check=$check1
    213212        ;;
  • trunk/MagicSoft/Mars/datacenter/scripts/sourcefile

    r9604 r9605  
    254254
    255255# function to get the join of a step
    256 #  (normal join but using different primaries)
    257256#  from the dependencies-file steps.rc
     257# $1 gives the step
     258# $2 gives the type of join
    258259function getjoin()
    259260{
    260261   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://"
    271263}
    272264
     
    276268   getdbsetup
    277269   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
     274function 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
    278283}
    279284
     
    289294      needprims=( `getprimary $need` )
    290295      # 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
    306304      fi
    307305   done
     
    310308   # add condition for the status of the peceding steps
    311309   counter=0
     310   specialneedjoin=
    312311   for need in $needs
    313312   do
     
    316315         query=$query" AND "
    317316      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" = " " ]
    326319      then
     320         # condition for step with same primaries
    327321         query=$query" NOT ISNULL("$need"Status.fStartTime) AND "
    328322         query=$query" NOT ISNULL("$need"Status.fStopTime) AND "
    329323         query=$query" ISNULL("$need"Status.fReturnCode) "
     324         specialneedjoin=
    330325      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
    345336         query=$query" AND NOT ISNULL(fStartTime) "
    346337         query=$query" AND NOT ISNULL(fStopTime) "
     
    500491   query=" UPDATE "$step"Status "
    501492   # add joins to the influenced tables
    502    stepspecialjoin=""
     493   specialinfljoin=`getjoin $step "SpecialInfluence"`
     494   if ! [ "$specialinfljoin" = "" ]
     495   then
     496      query=$query" "$specialinfljoin
     497   fi
    503498   for influence in $influences
    504499   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[@]}) "
    513505      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
    536507      fi
    537508   done
  • trunk/MagicSoft/Mars/resources/steps_fact.rc

    r9604 r9605  
    11
    22Corsika.Primaries: fRunNumber, fFileNumber
    3 Corsika.SpecialJoin: LEFT JOIN CeresInfo USING(fRunNumber, fFileNumber)
    4 Corsika.Join: LEFT JOIN CorsikaStatus USING(fRunNumber, fFileNumber)
    53
    64Ceres.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
     5Ceres.SpecialNeedJoin: LEFT JOIN CeresInfo USING(fSequenceNumber, fCeresSetupKEY)
     6Ceres.SpecialInfluenceJoin: LEFT JOIN CeresInfo USING(fRunNumber, fFileNumber, fCeresSetupKEY)
     7Ceres.NeedJoin: fSequenceNumber, fCeresSetupKEY
     8Ceres.InfluenceJoin: fRunNumber, fFileNumber
    109
    1110SequenceFile.Primaries: fSequenceNumber
    12 SequenceFile.Join: LEFT JOIN SequenceFileStatus USING(fSequenceNumber)
    1311
    1412Callisto.Primaries: fSequenceNumber, fCeresSetupKEY
    15 Callisto.Needs: Corsika Ceres SequenceFile
     13Callisto.Needs: SequenceFile Ceres Corsika
    1614
    1715Star.Primaries: fSequenceNumber, fCeresSetupKEY
    18 Star.Needs: Corsika Ceres SequenceFile Callisto
     16Star.Needs: Callisto SequenceFile Ceres Corsika
    1917
    20 
    21 
Note: See TracChangeset for help on using the changeset viewer.