- Timestamp:
- 01/15/10 09:27:25 (15 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r9537 r9539 18 18 19 19 -*-*- END OF LINE -*-*- 20 21 2010/01/15 Stefan Ruegamer 22 23 * datacenter/scripts/dowebplots, jobmanager 24 - if-condition if [ "$numproc" = "" ] now correctly checks for "0" 25 26 * datacenter/scripts/scriptlauncher 27 - added automationsetup variable in condor command 28 29 * datacenter/macros/buildsequenceentries.C 30 - where necessary changed Int to Long to account for the high value 31 of the stereo runs 32 33 * resources/sequences.rc 34 - added two transition conditions for the calibration scripts 35 10Led_UV_PEDANDCAL_1kHz and 10LED_UV 36 37 20 38 21 39 2009/12/23 Thomas Bretz -
trunk/MagicSoft/Mars/datacenter/macros/buildsequenceentries.C
r9213 r9539 90 90 #include <TExMap.h> 91 91 #include <TArrayI.h> 92 #include <TArrayL.h> 92 93 #include <TArrayD.h> 93 94 #include <TPRegexp.h> … … 103 104 using namespace std; 104 105 105 /*static*/ U Int_t GetId(const TString str)106 /*static*/ ULong_t GetId(const TString str) 106 107 { 107 108 const Ssiz_t dot = str.First('.'); … … 110 111 const UInt_t sub = dot<0 ? 0 : atoi(str.Data()+dot+1); 111 112 112 return run*1000+sub;113 return ULong_t(run)*1000+sub; 113 114 } 114 115 … … 119 120 TPRegexp fRegexp; 120 121 121 U Int_t fMin;122 U Int_t fMax;122 ULong_t fMin; 123 ULong_t fMax; 123 124 124 125 public: 125 126 Rule(TObjArray &arr) : 126 127 fRegexp(arr.GetEntries()>0?Form("^%s", arr[0]->GetName()):""), 127 fMin(0), fMax((U Int_t)-1)128 fMin(0), fMax((ULong_t)-1) 128 129 { 129 130 if (arr.GetEntries()>1) … … 133 134 } 134 135 135 Ssiz_t Match(const TString &str, Int_t idx, Int_t run=-1)136 Ssiz_t Match(const TString &str, Int_t idx, Long_t run=-1) 136 137 { 137 138 if (!IsValid(run)) … … 145 146 } 146 147 147 Bool_t IsValid(U Int_t run) const { return run<0 || (run>=fMin && run<=fMax); }148 Bool_t IsValid(ULong_t run) const { return run>=fMin && run<=fMax; } 148 149 ClassDef(Rule, 0) 149 150 }; … … 159 160 TPRegexp fRegexp2; 160 161 161 U Int_t fMin;162 U Int_t fMax;162 ULong_t fMin; 163 ULong_t fMax; 163 164 164 165 void Init(const TObjArray &arr, Int_t idx=0) … … 191 192 CheckMatch() : fRunType1(""), fRunType2(""), fRegexp1(""), fRegexp2("") {} 192 193 193 CheckMatch(const TString &txt) : fRunType1(""), fRunType2(""), fRegexp1(""), fRegexp2(""), fMin(0), fMax((U Int_t)-1)194 CheckMatch(const TString &txt) : fRunType1(""), fRunType2(""), fRegexp1(""), fRegexp2(""), fMin(0), fMax((ULong_t)-1) 194 195 { 195 196 TObjArray *arr = txt.Tokenize(" "); … … 198 199 } 199 200 200 CheckMatch(TObjArray &arr, Int_t idx=0) : fRunType1(""), fRunType2(""), fRegexp1(""), fRegexp2(""), fMin(0), fMax((U Int_t)-1)201 CheckMatch(TObjArray &arr, Int_t idx=0) : fRunType1(""), fRunType2(""), fRegexp1(""), fRegexp2(""), fMin(0), fMax((ULong_t)-1) 201 202 { 202 203 Init(arr, idx); 203 204 } 204 205 205 CheckMatch(const char *from, const char *to, Int_t min=0, Int_t max=-1)206 CheckMatch(const char *from, const char *to, Long_t min=0, Long_t max=-1) 206 207 : fRunType1(".*"), fRunType2(".*"), fRegexp1(Form("^%s$", from)), fRegexp2(Form("^%s$", to)), fMin(min), fMax(max) 207 208 { 208 209 } 209 210 210 Int_t Matches(const TString &rt1, const TString &rt2, const TString &lc1, const TString &lc2, U Int_t run=0)211 Int_t Matches(const TString &rt1, const TString &rt2, const TString &lc1, const TString &lc2, ULong_t run=0) 211 212 { 212 213 if (run>0) … … 234 235 public: 235 236 CheckList() { SetOwner(); } 236 Int_t Matches(const TString &rt1, const TString &rt2, const TString &lc1, const TString &lc2, Int_t run=-1) const237 Int_t Matches(const TString &rt1, const TString &rt2, const TString &lc1, const TString &lc2, Long_t run=-1) const 237 238 { 238 239 TIter Next(this); … … 277 278 // (row[i]) and the current run-type (row[1]) matches the attribute 278 279 // of the last run (keys[i] with run-type row[i]) 279 return list->Matches(keys[1], row[1], keys[i], row[i], ato i(row[0]));280 } 281 282 Bool_t InsertSequence( Int_t from, Int_t to)280 return list->Matches(keys[1], row[1], keys[i], row[i], atol(row[0])); 281 } 282 283 Bool_t InsertSequence(Long_t from, Long_t to) 283 284 { 284 285 cout << " - Inserting Sequence into database." << endl; … … 291 292 "SUM(TIME_TO_SEC(TIMEDIFF(fRunStop,fRunStart))), "; 292 293 293 const TString where = Form("(fRunNumber*1000+fFileNumber BETWEEN % d AND %d) "294 const TString where = Form("(fRunNumber*1000+fFileNumber BETWEEN %ld AND %ld) " 294 295 "AND fTelescopeNumber=%d AND fExcludedFDAKEY=1", 295 296 from, to, fTelescopeNumber); … … 361 362 } 362 363 363 const TString set = Form("fSequenceFirst=% d, fTelescopeNumber=%d ", from/1000, fTelescopeNumber);364 const TString set = Form("fSequenceFirst=%ld, fTelescopeNumber=%d ", from/1000, fTelescopeNumber); 364 365 365 366 TString query1; 366 367 query1 += set; 367 query1 += Form(",fSequenceLast=% d,", to/1000);368 query1 += Form(",fSequenceLast=%ld,", to/1000); 368 369 query1 += Form(" fSourceKEY=%s,", (*row)[0]); 369 370 query1 += Form(" fProjectKEY=%s,", (*row)[1]); … … 404 405 405 406 TString prio = set; 406 prio += Form(", fPriority=% d ", from/1000);407 prio += Form(", fPriority=%ld ", from/1000); 407 408 if (!Insert("SequenceProcessStatus", prio)) 408 409 { … … 465 466 } 466 467 467 Int_t CheckSequence( Int_t runstart, Int_t runstop)468 Int_t CheckSequence(Long_t runstart, Long_t runstop) 468 469 { 469 470 const char *fmt1 = "SELECT fRunNumber*1000+fFileNumber AS Id FROM RunData WHERE"; 470 471 const char *fmt2 = "AND fExcludedFDAKEY=1 AND (fRunTypeKEY BETWEEN 2 AND 4) ORDER BY Id"; 471 472 472 const TString query1 = Form("%s fTelescopeNumber=%d AND fSequenceFirst=% d %s",fmt1, fTelescopeNumber, runstart/1000, fmt2);473 const TString query2 = Form("%s fTelescopeNumber=%d AND fRunNumber*1000+fFileNumber BETWEEN % d AND %d %s", fmt1, fTelescopeNumber, runstart, runstop, fmt2);473 const TString query1 = Form("%s fTelescopeNumber=%d AND fSequenceFirst=%ld %s", fmt1, fTelescopeNumber, runstart/1000, fmt2); 474 const TString query2 = Form("%s fTelescopeNumber=%d AND fRunNumber*1000+fFileNumber BETWEEN %ld AND %ld %s", fmt1, fTelescopeNumber, runstart, runstop, fmt2); 474 475 475 476 TSQLResult *res1 = Query(query1); … … 495 496 return kFALSE; 496 497 497 if (ato i((*row1)[0])!=atoi((*row2)[0]))498 if (atol((*row1)[0])!=atol((*row2)[0])) 498 499 return kFALSE; 499 500 } … … 502 503 } 503 504 504 Int_t CreateSequence( Int_t runstart, Int_t runstop)505 Int_t CreateSequence(Long_t runstart, Long_t runstop) 505 506 { 506 507 cout << " * Creating Sequence " << runstart << "-" << runstop << ":" << endl; … … 508 509 TString query= 509 510 Form("SELECT fSequenceFirst FROM RunData " 510 " WHERE fRunNumber*1000+fFileNumber BETWEEN % d AND %d AND "511 " WHERE fRunNumber*1000+fFileNumber BETWEEN %ld AND %ld AND " 511 512 " fTelescopeNumber=%d AND fSequenceFirst>0 AND " 512 513 " fExcludedFDAKEY=1 AND (fRunTypeKEY BETWEEN 2 AND 4)" … … 794 795 } 795 796 796 TString PrepareString(TSQLResult &res, TArray I&runs)797 TString PrepareString(TSQLResult &res, TArrayL &runs) 797 798 { 798 799 // Number of result rows … … 810 811 while ((row=res.Next())) 811 812 { 812 runs[idx] = ato i((*row)[0]); // run number813 runs[idx] = atol((*row)[0]); // run number 813 814 814 815 const TString tstart = ((*row)[2]); // start time … … 862 863 } 863 864 864 void PrintResidual( Int_t runstart, Int_t runstop, TString residual, const char *descr)865 void PrintResidual(Long_t runstart, Long_t runstop, TString residual, const char *descr) 865 866 { 866 867 residual.ToLower(); … … 891 892 } 892 893 893 Int_t SplitBlock( Int_t runstart, Int_t runstop, const TString &cond)894 Int_t SplitBlock(Long_t runstart, Long_t runstop, const TString &cond) 894 895 { 895 896 // Request data necessary to split block into sequences … … 897 898 Form("SELECT fRunNumber*1000+fFileNumber AS Id, fRunTypeKEY, fRunStart, fRunStop" 898 899 " FROM RunData " 899 " WHERE fRunNumber*1000+fFileNumber BETWEEN % d AND %d AND "900 " WHERE fRunNumber*1000+fFileNumber BETWEEN %ld AND %ld AND " 900 901 /*" fExcludedFDAKEY=1 AND (fRunTypeKEY BETWEEN 2 AND 4)" 901 902 " ORDER BY Id"*/, runstart, runstop); … … 912 913 // Get String containing the sequence of P-,C- and D-Runs 913 914 // and an array with the corresponding run-numbers 914 TArray Iruns;915 TArrayL runs; 915 916 const TString str = PrepareString(*res, runs); 916 917 … … 1035 1036 // This is the runnumber of the first run in the new block 1036 1037 if (runstart<0) 1037 runstart=ato i((*row)[0]);1038 runstart=atol((*row)[0]); 1038 1039 1039 1040 // Check which transitions might be allowed for this run and … … 1085 1086 1086 1087 // This is already the first run of the new block 1087 runstart=ato i((*row)[0]);1088 runstart=atol((*row)[0]); 1088 1089 1089 1090 // These are the keys corresponding to the first run … … 1101 1102 1102 1103 // This is the new runnumber of the last run in this block 1103 runstop=ato i((*row)[0]);1104 runstop=atol((*row)[0]); 1104 1105 } 1105 1106 -
trunk/MagicSoft/Mars/datacenter/scripts/dowebplots
r9149 r9539 187 187 # remove name from list in case there is nothing left to do 188 188 getstatus >> $scriptlog 2>&1 189 if [ "$numproc" = " " ]189 if [ "$numproc" = "0" ] 190 190 then 191 191 unset all[$a] -
trunk/MagicSoft/Mars/datacenter/scripts/jobmanager
r9493 r9539 127 127 # check number of processes to be done 128 128 echo `date +%F\ %T`" Database: $numproc ${scripts[$i]} still to be done (incl. idle jobs) [DB/table/column $db/$table/$column]" >> $jmscriptlog 2>&1 129 if [ "$numproc" = " " ]129 if [ "$numproc" = "0" ] 130 130 then 131 131 prev=0 -
trunk/MagicSoft/Mars/datacenter/scripts/scriptlauncher
r9130 r9539 75 75 fi 76 76 echo " launching $1..." >> $scriptlog 2>&1 77 echo "/usr/local/bin/condor_submit -a path=$path -a prog=$prog -a args=\"$arguments\" -a date=$date -a dir=$runlogpath $path/run.condor 2>> $errorlog | grep 'submitted to cluster' | cut -dr -f2" >> $scriptlog 2>&178 pid=`/usr/local/bin/condor_submit -a path=$path -a prog=$prog -a args="$arguments" -a date=$date -a dir=$runlogpath $path/run.condor 2>> $errorlog | grep 'submitted to cluster' | cut -dr -f2`77 echo "/usr/local/bin/condor_submit -a path=$path -a prog=$prog -a args=\"$arguments\" -a date=$date -a dir=$runlogpath -a automationsetup=$AUTOMATIONSETUP $path/run.condor 2>> $errorlog | grep 'submitted to cluster' | cut -dr -f2" >> $scriptlog 2>&1 78 pid=`/usr/local/bin/condor_submit -a path=$path -a prog=$prog -a args="$arguments" -a date=$date -a dir=$runlogpath -a automationsetup=$AUTOMATIONSETUP $path/run.condor 2>> $errorlog | grep 'submitted to cluster' | cut -dr -f2` 79 79 if [ "$pid" = "" ] 80 80 then -
trunk/MagicSoft/Mars/resources/sequences.rc
r9005 r9539 121 121 # C 195: 1Led_Blue 122 122 # C 207: 10Led_UV_PinDiode 123 # C 256: 10Led_UV_PEDANDCAL_1kHz 123 124 # D 179: 10Led_UV_50Hz 124 125 # D 209: 10Led_UV_50Hz_PinDiode … … 136 137 CalibrationScript 4 3 207 199 53875 200000 137 138 CalibrationScript 4 2 207 245 200000 139 CalibrationScript 3 4 199 256 1007866 140 CalibrationScript 4 2 256 245 1007866 141 CalibrationScript 3 4 199 181 1007844 142 CalibrationScript 4 2 181 245 1007844 138 143 139 144 # Previous defaults. This are cases which are widely used
Note:
See TracChangeset
for help on using the changeset viewer.