Changeset 7467
- Timestamp:
- 01/31/06 14:53:08 (19 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r7466 r7467 18 18 19 19 -*-*- 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 20 38 2006/01/30 Daniel Hoehne 21 39 -
trunk/MagicSoft/Mars/datacenter/macros/getdolist.C
r7464 r7467 130 130 rc.GetValue(table+".TimerTable", ""), 131 131 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()); 133 133 134 134 TIter Next(&l); -
trunk/MagicSoft/Mars/datacenter/macros/setstatus.C
r7464 r7467 33 33 // 34 34 // 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) 36 36 // The first argument is the primary (date/run/sequence/dataset), the second 37 37 // and third argument give the table and column of the step. The fourth 38 38 // column is giving the statustime, to which the column has to be set. The 39 39 // 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). 41 42 // The last argument is indicating if the columns of all influenced steps 42 43 // shall be reset to NULL. The default is kTRUE, which means, that the … … 122 123 TString influences = rc.GetValue(table+"."+column+".Influences", ""); 123 124 124 TString query(Form("UPDATE %s SET %s=%s, fFailed=%s, f StartTime=%s, fFailedTime=%s ",125 TString query(Form("UPDATE %s SET %s=%s, fFailed=%s, fFailedTime=%s ", 125 126 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()); 127 130 128 131 while (!influences.IsNull() && resetall) … … 160 163 } 161 164 162 int setstatus(TString primary, TString table, TString column, TString statustime, TString failed , TString starttime, TString failedtime, Bool_t resetall=kTRUE)165 int setstatus(TString primary, TString table, TString column, TString statustime, TString failedcode, TString failedcomment, TString starttime, TString failedtime, Bool_t resetall=kTRUE) 163 166 { 164 167 TEnv env("sql.rc"); … … 179 182 180 183 //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); 182 185 183 186 } -
trunk/MagicSoft/Mars/datacenter/scripts/runcallisto
r7465 r7467 170 170 fi 171 171 172 echo "run callisto..." >> $scriptlog 2>&1 172 echo "run $program..." >> $scriptlog 2>&1 173 setstatus "start" 174 173 175 ./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 174 176 check1=$? … … 206 208 then 207 209 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 209 213 fi 210 214 echo "cacofile: "$cacofile >> $scriptlog 2>&1 … … 229 233 fi 230 234 done 235 echo "no cacofile found" >> $scriptlog 2>&1 236 com="no cacofile for run $runno" 237 check=0 238 break 231 239 fi 232 240 ./merpp -u --log=$merpplogpath/merppccupdate$runno.log --html=$merpplogpath/merppccupdate$runno.html --auto-time-stop --runfile=$runno $ccfile $calfile 2>> $scriptlog> /dev/null … … 235 243 0) echo "check2=$check2 -> everything ok, merppccupdate worked -> continue" >> $scriptlog 2>&1;; 236 244 *) echo "check2=$check2 -> ERROR -> merppccupdate failed" >> $scriptlog 2>&1 237 continue 2 ;; 245 com="merppccupdate failed for run $runno" 246 check=$check2 247 break ;; 238 248 esac 239 249 ./merpp -u --log=$merpplogpath/merppcacoupdate$runno.log --html=$merpplogpath/merppcacoupdate$runno.html --auto-time $cacofile $calfile 2>> $scriptlog> /dev/null … … 242 252 0) echo "check3=$check3 -> everything ok, merppcacoupdate worked -> continue" >> $scriptlog 2>&1;; 243 253 *) echo "check3=$check3 -> ERROR -> merppcacoupdate failed" >> $scriptlog 2>&1 244 continue 2 ;; 254 com="merppcacoupdate failed for run $runno" 255 check=$check3 256 break ;; 245 257 esac 246 258 done 247 248 # set status for calibration if merpp updates are also done249 echo "inserting the status for $program for sequence $sequence into the db" >> $scriptlog 2>&1250 statustime="Now()"251 failed="NULL"252 starttime="NULL"253 failedtime="NULL"254 var1=$no255 var2=$no2256 setstatus257 259 ;; 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 ;; 259 264 esac 265 # set status 266 echo "inserting the status for $program for sequence $sequence into the db" >> $scriptlog 2>&1 267 setstatus "stop" 260 268 done 261 269 -
trunk/MagicSoft/Mars/datacenter/scripts/runganymed
r7465 r7467 160 160 161 161 echo "run $program..." >> $scriptlog 2>&1 162 setstatus "start" 163 162 164 ./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 163 165 check1=$? 164 166 165 167 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 175 172 ;; 176 *) echo "check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1;;177 173 esac 174 echo "inserting the status for $program for dataset $dataset into the db" >> $scriptlog 2>&1 175 setstatus "stop" 178 176 done 179 177 -
trunk/MagicSoft/Mars/datacenter/scripts/runstar
r7465 r7467 152 152 153 153 echo "run $program..." >> $scriptlog 2>&1 154 setstatus "start" 155 154 156 ./star -b -q -v4 -f --log=$outpath/$program$no2.log --html=$outpath/$program$no2.html --ind=$inpath --out=$outpath $sequfile 2>> $scriptlog> /dev/null 155 157 check1=$? 156 158 157 159 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 ;; 169 165 esac 166 echo "inserting the status for $program for sequence $sequence into the db" >> $scriptlog 2>&1 167 setstatus "stop" 170 168 done 171 169 -
trunk/MagicSoft/Mars/datacenter/scripts/sourcefile
r7465 r7467 61 61 } 62 62 63 function resetstatusvalues() 64 { 65 statustime=NULL 66 starttime=NULL 67 failedcode=NULL 68 failedcomment=NULL 69 failedtime=NULL 70 } 71 72 function 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 63 85 function setstatus() 64 86 { 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 65 113 setstatuslogpath=$logpath/setstatus/$program/$var1 66 114 makedir $setstatuslogpath >> $scriptlog 2>&1 67 setstatuslog=$setstatuslogpath/setstatus-$ program-$var2.log68 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)//'` 69 117 case $checkstatus in 70 118 1) echo "checkstatus=$checkstatus -> everything ok, status has been set" >> $scriptlog 2>&1;; … … 72 120 esac 73 121 } 122 123 124
Note:
See TracChangeset
for help on using the changeset viewer.