Changeset 7467 for trunk/MagicSoft


Ignore:
Timestamp:
01/31/06 14:53:08 (19 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r7466 r7467  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
     20 2006/01/30 Daniela Dorner
     21
     22   * datacenter/macros/setstatus.C, getdolist.C:
     23     - adapted macros to changes in new columns (fFailedCode,
     24       fFailedComment)
     25
     26   * datacenter/macros/setstatus.C:
     27     - added "noreset" for column fStartTime (is needed so that runtime
     28       is available in case of failure)
     29
     30   * datacenter/scripts/runcallisto, runganymed, runstar:
     31     - implemented failure handling
     32
     33   * datacenter/scripts/sourcefile:
     34     - implemented new functions to set status values
     35
     36
     37
    2038 2006/01/30 Daniel Hoehne
    2139
  • trunk/MagicSoft/Mars/datacenter/macros/getdolist.C

    r7464 r7467  
    130130                    rc.GetValue(table+".TimerTable", ""),
    131131                    rc.GetValue(table+".Primary", ""));
    132     query+=Form(" WHERE ISNULL(%s) AND ISNULL(fFailed) AND ISNULL(fStartTime) AND ISNULL(fFailedTime) ", column.Data());
     132    query+=Form(" WHERE ISNULL(%s) AND ISNULL(fFailedCode) AND ISNULL(fFailedComment) AND ISNULL(fStartTime) AND ISNULL(fFailedTime) ", column.Data());
    133133
    134134    TIter Next(&l);
  • trunk/MagicSoft/Mars/datacenter/macros/setstatus.C

    r7464 r7467  
    3333//
    3434// Usage:
    35 //  .x setstatus.C+("primary","table","column","statustime","failed","starttime","failedtime",kTRUE)
     35//  .x setstatus.C+("primary","table","column","statustime","failedcode","failedcomment","starttime","failedtime",kTRUE)
    3636// The first argument is the primary (date/run/sequence/dataset), the second
    3737// and third argument give the table and column of the step. The fourth
    3838// column is giving the statustime, to which the column has to be set. The
    3939// fifth argument is giving the error code (in case of failure), the sixth
    40 // the starttime and the seventh the stoptime (only in case of failure).
     40// an error comment, the seventh the starttime and the eigth the stoptime
     41// (only in case of failure).
    4142// The last argument is indicating if the columns of all influenced steps
    4243// shall be reset to NULL. The default is kTRUE, which means, that the
     
    122123    TString influences  = rc.GetValue(table+"."+column+".Influences", "");
    123124
    124     TString query(Form("UPDATE %s SET %s=%s, fFailed=%s, fStartTime=%s, fFailedTime=%s ",
     125    TString query(Form("UPDATE %s SET %s=%s, fFailed=%s, fFailedTime=%s ",
    125126                       table.Data(), column.Data(), statustime.Data(), failed.Data(),
    126                        starttime.Data(), failedtime.Data()));
     127                       failedtime.Data()));
     128    if (starttime.CompareTo("noreset"))
     129        query += Form(", fStartTime=%s", starttime.Data());
    127130
    128131    while (!influences.IsNull() && resetall)
     
    160163}
    161164
    162 int setstatus(TString primary, TString table, TString column, TString statustime, TString failed, TString starttime, TString failedtime, Bool_t resetall=kTRUE)
     165int setstatus(TString primary, TString table, TString column, TString statustime, TString failedcode, TString failedcomment, TString starttime, TString failedtime, Bool_t resetall=kTRUE)
    163166{
    164167    TEnv env("sql.rc");
     
    179182
    180183    //if reset is needed and/or can be done, set new values
    181     return !CheckReset(rc, table, column, statustime) ? 0 : SetInfluences(serv, rc, primary, table, column, statustime, failed, starttime, failedtime, resetall);
     184    return !CheckReset(rc, table, column, statustime) ? 0 : SetInfluences(serv, rc, primary, table, column, statustime, failedcode, failedcomment, starttime, failedtime, resetall);
    182185
    183186}
  • trunk/MagicSoft/Mars/datacenter/scripts/runcallisto

    r7465 r7467  
    170170  fi
    171171
    172   echo "run callisto..." >> $scriptlog 2>&1
     172  echo "run $program..." >> $scriptlog 2>&1
     173  setstatus "start"
     174
    173175  ./callisto -b -q -v4 -f -raw --log=$outpath/$program$no2.log --html=$outpath/$program$no2.html --out=$outpath --config=$callistorcseq $sequfile  2>> $scriptlog > /dev/null
    174176  check1=$?
     
    206208             then
    207209                echo "no ccfile found for run "$runno >> $scriptlog 2>&1
    208                 break 2
     210                com="no ccfile for run $runno"
     211                check=0
     212                break
    209213             fi
    210214             echo "cacofile: "$cacofile >> $scriptlog 2>&1
     
    229233                   fi
    230234                done
     235                echo "no cacofile found" >> $scriptlog 2>&1
     236                com="no cacofile for run $runno"
     237                check=0
     238                break
    231239             fi
    232240             ./merpp -u --log=$merpplogpath/merppccupdate$runno.log --html=$merpplogpath/merppccupdate$runno.html --auto-time-stop --runfile=$runno $ccfile $calfile 2>> $scriptlog> /dev/null
     
    235243                     0)   echo "check2=$check2 -> everything ok, merppccupdate worked -> continue" >> $scriptlog 2>&1;;
    236244                     *)   echo "check2=$check2 -> ERROR -> merppccupdate failed" >> $scriptlog 2>&1
    237                           continue 2 ;;
     245                          com="merppccupdate failed for run $runno"
     246                          check=$check2
     247                          break ;;
    238248             esac
    239249             ./merpp -u --log=$merpplogpath/merppcacoupdate$runno.log --html=$merpplogpath/merppcacoupdate$runno.html --auto-time $cacofile $calfile 2>> $scriptlog> /dev/null
     
    242252                     0)   echo "check3=$check3 -> everything ok, merppcacoupdate worked -> continue" >> $scriptlog 2>&1;;
    243253                     *)   echo "check3=$check3 -> ERROR -> merppcacoupdate failed" >> $scriptlog 2>&1
    244                           continue 2 ;;
     254                          com="merppcacoupdate failed for run $runno"
     255                          check=$check3
     256                          break ;;
    245257             esac
    246258          done
    247          
    248           # set status for calibration if merpp updates are also done
    249           echo "inserting the status for $program for sequence $sequence into the db" >> $scriptlog 2>&1
    250           statustime="Now()"
    251           failed="NULL"
    252           starttime="NULL"
    253           failedtime="NULL"
    254           var1=$no
    255           var2=$no2
    256           setstatus
    257259          ;;
    258      *)   echo "check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1;;
     260     *)   echo "check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
     261          com="calibration failed"
     262          check=$check1
     263          ;;
    259264  esac
     265  # set status
     266  echo "inserting the status for $program for sequence $sequence into the db" >> $scriptlog 2>&1
     267  setstatus "stop"
    260268done
    261269
  • trunk/MagicSoft/Mars/datacenter/scripts/runganymed

    r7465 r7467  
    160160 
    161161  echo "run $program..." >> $scriptlog 2>&1
     162  setstatus "start"
     163
    162164  ./ganymed -b -q -v4 -f --ind=$datapath/star --config=$ganymedrc --log=$outpath/$program$no2.log --html=$outpath/$program$no2.html --out=$outpath $datasetfile  2>> $scriptlog> /dev/null
    163165  check1=$?
    164166
    165167  case $check1 in
    166      0)   echo "check1=$check1 -> everything ok " >> $scriptlog 2>&1
    167           echo "inserting the status for $program for dataset $dataset into the db" >> $scriptlog 2>&1
    168           statustime="Now()"
    169           failed="NULL"
    170           starttime="NULL"
    171           failedtime="NULL"
    172           var1=$no
    173           var2=$no2
    174           setstatus
     168     0)   echo "check1=$check1 -> everything ok " >> $scriptlog 2>&1 ;;
     169     *)   echo "check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
     170          com="ganymed failed"
     171          check=$check1
    175172          ;;
    176      *)   echo "check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1;;
    177173  esac
     174  echo "inserting the status for $program for dataset $dataset into the db" >> $scriptlog 2>&1
     175  setstatus "stop"
    178176done
    179177
  • trunk/MagicSoft/Mars/datacenter/scripts/runstar

    r7465 r7467  
    152152 
    153153  echo "run $program..." >> $scriptlog 2>&1
     154  setstatus "start"
     155
    154156  ./star -b -q -v4 -f --log=$outpath/$program$no2.log --html=$outpath/$program$no2.html --ind=$inpath --out=$outpath $sequfile  2>> $scriptlog> /dev/null
    155157  check1=$?
    156158
    157159  case $check1 in
    158      0)   echo "check1=$check1 -> everything ok " >> $scriptlog 2>&1
    159           echo "inserting the status for $program for sequence $sequence into the db" >> $scriptlog 2>&1
    160           statustime="Now()"
    161           failed="NULL"
    162           starttime="NULL"
    163           failedtime="NULL"
    164           var1=$no
    165           var2=$no2
    166           setstatus
    167           ;;
    168      *)   echo "check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1;;
     160     0)   echo "check1=$check1 -> everything ok " >> $scriptlog 2>&1;;
     161     *)   echo "check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
     162          com="star failed"
     163          check=$check1
     164          ;;
    169165  esac
     166  echo "inserting the status for $program for sequence $sequence into the db" >> $scriptlog 2>&1
     167  setstatus "stop"
    170168done
    171169
  • trunk/MagicSoft/Mars/datacenter/scripts/sourcefile

    r7465 r7467  
    6161}
    6262
     63function resetstatusvalues()
     64{
     65   statustime=NULL
     66   starttime=NULL
     67   failedcode=NULL
     68   failedcomment=NULL
     69   failedtime=NULL
     70}
     71
     72function printstatusvalues()
     73{
     74   echo "the current values are:"
     75   echo " statustime=$statustime"
     76   echo " starttime=$starttime"
     77   echo " failedcode=$failedcode"
     78   echo " failedcomment=$failedcomment"
     79   echo " failedtime=$failedtime"
     80   echo "-- check: -$check-"
     81   ech
     82   echo ""
     83}
     84
    6385function setstatus()
    6486{
     87   # set status values
     88   resetstatusvalues
     89   case $@ in
     90      start)   echo "start"
     91               starttime="Now()"
     92               ;;
     93       stop)   echo "stop"
     94               case $check in
     95                  0)  echo " ok"
     96                      statustime="Now()"
     97                      ;;
     98                  *)  echo " failed"
     99                      starttime=noreset
     100                      failedcode=$check
     101                      failedcomment=$com
     102                      failedtime="Now()"
     103                      ;;
     104               esac
     105               ;;
     106          *)   echo "error -> exit"
     107               exit
     108               ;;
     109   esac
     110   check=
     111   
     112   # set status
    65113   setstatuslogpath=$logpath/setstatus/$program/$var1
    66114   makedir $setstatuslogpath >> $scriptlog 2>&1
    67    setstatuslog=$setstatuslogpath/setstatus-$program-$var2.log
    68    checkstatus=`root -q -b $macrospath/setstatus.C+\("\"$sequence\""\,"\"$table\""\,"\"$column\""\,"\"$statustime\""\,"\"$failed\""\,"\"$starttime\""\,"\"$failedtime\""\) | tee $setstatuslog | grep int | sed -e 's/(int)//'`
     115   setstatuslog=$setstatuslogpath/setstatus-$@-$program-$var2.log
     116   checkstatus=`root -q -b $macrospath/setstatus.C+\("\"$sequence\""\,"\"$table\""\,"\"$column\""\,"\"$statustime\""\,"\"$failedcode\""\,"\"$failedcomment\""\,"\"$starttime\""\,"\"$failedtime\""\) | tee $setstatuslog | grep int | sed -e 's/(int)//'`
    69117   case $checkstatus in
    70118      1)   echo "checkstatus=$checkstatus -> everything ok, status has been set" >> $scriptlog 2>&1;;
     
    72120   esac
    73121}
     122
     123
     124
Note: See TracChangeset for help on using the changeset viewer.