Changeset 7256 for trunk/MagicSoft
- Timestamp:
- 08/03/05 20:45:43 (19 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r7255 r7256 18 18 19 19 -*-*- END OF LINE -*-*- 20 21 2005/08/02 Daniela Dorner 22 23 * datacenter/macros/getdolist.C: 24 - added if-clause to distinguish between steps that need one todo 25 file and steps that need one todo file per sequence/dataset (i.e. 26 callisto, star, ganymed) and added writing of these files 27 28 * datacenter/scripts/runcallisto, runganymed, runstar: 29 - adapted scripts to the changes in getdolist.C (removed lines to 30 divide todo file, changed getting of todo file) 31 32 * datacenter/scripts/runcallisto: 33 - added if-clause for the choosing of the correct callisto.rc 34 (needed due to the new callist_MarApr05.rc which is applied 35 between sequence 49736 and 53315 36 37 20 38 21 39 2005/08/02 Daniela Dorner -
trunk/MagicSoft/Mars/datacenter/macros/getdolist.C
r7235 r7256 118 118 return 0; 119 119 120 TString filename(Form("%s/ToDo-%s-%s.txt", listpath.Data(), table.Data(), column.Data())); 121 ofstream fout(filename, ios::app); 122 if (!fout) 120 121 TString filename; 122 TSQLRow *row=0; 123 124 if ((table=="SequenceProcessStatus" && column=="fCallisto") || 125 (table=="SequenceProcessStatus" && column=="fStar") || 126 (table=="DataSetProcessStatus" && column=="fGanymed")) 123 127 { 124 cout << "ERROR - Cannot open file " << filename << endl; 125 return 0; 128 while ((row = res->Next())) 129 { 130 filename=Form("%s/ToDo-%s-%s-%s.txt", listpath.Data(), table.Data(), column.Data(), (*row)[0]); 131 ofstream fout(filename, ios::app); 132 if (!fout) 133 { 134 cout << "ERROR - Cannot open file " << filename << endl; 135 return 0; 136 } 137 fout << (*row)[0] << endl; 138 } 126 139 } 140 else 141 { 142 filename=Form("%s/ToDo-%s-%s.txt", listpath.Data(), table.Data(), column.Data()); 143 ofstream fout(filename, ios::app); 144 if (!fout) 145 { 146 cout << "ERROR - Cannot open file " << filename << endl; 147 return 0; 148 } 127 149 128 TSQLRow *row=0;129 while ((row = res->Next()))130 fout << (*row)[0] << endl;150 while ((row = res->Next())) 151 fout << (*row)[0] << endl; 152 } 131 153 132 154 delete res; -
trunk/MagicSoft/Mars/datacenter/scripts/runcallisto
r7233 r7256 33 33 34 34 callistorcnew=$setuppath/callisto/callisto.rc 35 callistorcmarapr05=$setuppath/callisto/callisto_MarApr05.rc 35 36 36 37 table=SequenceProcessStatus … … 39 40 datetime=`date +%F-%H-%M-%S` 40 41 year=`date +%Y` 41 pno=500 # number of processes, i.e. number of todo-files42 #pno=500 # number of processes, i.e. number of todo-files 42 43 43 44 todofile=$listpath/ToDo-$table-$column … … 72 73 echo " -> choose one file and start calibrating" >> $scriptlog 2>&1 73 74 else 74 # echo "run checkfilesforsequenceavail" >> $scriptlog 2>&175 # $scriptspath/checkfilesforsequenceavail76 77 75 echo "getting list..." >> $scriptlog 2>&1 78 76 check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\,"\"$listpath\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'` … … 82 80 *) echo "check0=$check0 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1;; 83 81 esac 84 echo "cutting to-do-file" >> $scriptlog 2>&185 echo "getting no of lines" >> $scriptlog 2>&186 lines=`cat $todofile.txt | wc -l`87 echo "number of lines: "$lines >> $scriptlog 2>&188 while (( "$lines" < "$pno" ))89 do90 echo "# of lines ($lines) < # of processes ($pno) "91 pno=`expr $pno / 2`92 done93 echo "pno: "$pno94 nofiles=`expr $lines / \( $pno - 1 \)`95 nofiles=`expr $nofiles + 1 `96 echo "number of files: "$nofiles >> $scriptlog 2>&197 echo "deviding todo-file" >> $scriptlog 2>&198 for (( j=1 ; j <= $pno ; j++ ))99 do100 begin=$(echo "1 + ( ($j - 1) * $nofiles)" | bc -l)101 end=$(echo "$begin + $nofiles - 1" | bc -l)102 echo "begin: "$begin >> $scriptlog 2>&1103 echo "end: "$end >> $scriptlog 2>&1104 file=${todofile}-${j}.txt105 echo "file: "$file >> $scriptlog 2>&1106 sed -ne ''"$begin"','"$end"'w '"$file"'' $todofile.txt107 done108 109 rm -v $todofile.txt >> $scriptlog 2>&1110 82 fi 111 83 … … 114 86 nr=bla 115 87 echo "finding the right todo-file" >> $scriptlog 2>&1 116 for (( i = 1; i <= $pno ; i++ )) 88 todofiles=`ls $listpath/ToDo-$table-$column-*` 89 90 echo "todofiles: "${todofiles[@]} >> $scriptlog 2>&1 91 92 for todofile in ${todofiles[@]} 117 93 do 118 if ! ls $todofile -$i.txt>> $scriptlog 2>&194 if ! ls $todofile >> $scriptlog 2>&1 119 95 then 120 96 echo "file is not on disk -> continue" >> $scriptlog 2>&1 121 97 continue 122 98 fi 123 date > $lockpath/lock-$table-$column-$i.txt >> $scriptlog 2>&1 99 lockfile=`echo $todofile | sed -e 's/lists/locks/' -e 's/ToDo/lock/'` 100 date > $lockfile >> $scriptlog 2>&1 124 101 checklock=$? 125 102 case $checklock in … … 139 116 esac 140 117 141 142 sequences=(`cat $todofile-$nr.txt`) 118 sequences=(`cat $todofile`) 143 119 144 120 if [ "$sequences" = "" ] 145 121 then 146 122 echo "nothing to do -> exit" >> $scriptlog 2>&1 147 rm -v $todofile -$nr.txt>> $scriptlog 2>&1148 rm -v $lock path/lock-$table-$column-$nr.txt>> $scriptlog 2>&1123 rm -v $todofile >> $scriptlog 2>&1 124 rm -v $lockfile >> $scriptlog 2>&1 149 125 date >> $scriptlog 2>&1 150 126 exit … … 170 146 else 171 147 echo "no callisto.rc found in $outpath -> making link " >> $scriptlog 2>&1 172 ln -vs $callistorcnew $outpath/callisto.rc >> $scriptlog 2>&1 148 if [ 49735 -lt $sequence ] && [ $sequence -lt 53516 ] 149 then 150 ln -vs $callistorcmarapr05 $outpath/callisto.rc >> $scriptlog 2>&1 151 else 152 ln -vs $callistorcnew $outpath/callisto.rc >> $scriptlog 2>&1 153 fi 173 154 callistorcseq=$outpath/callisto.rc 174 155 fi … … 258 239 done 259 240 260 rm -v $todofile -$nr.txt>> $scriptlog 2>&1261 rm -v $lock path/lock-$table-$column-$nr.txt>> $scriptlog 2>&1241 rm -v $todofile >> $scriptlog 2>&1 242 rm -v $lockfile >> $scriptlog 2>&1 262 243 263 244 set +C -
trunk/MagicSoft/Mars/datacenter/scripts/runganymed
r7233 r7256 37 37 datetime=`date +%F-%H-%M-%S` 38 38 year=`date +%Y` 39 pno=24 # number of processes, i.e. number of todo-files39 #pno=24 # number of processes, i.e. number of todo-files 40 40 41 41 todofile=$listpath/ToDo-$table-$column … … 78 78 *) echo "check0=$check0 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1;; 79 79 esac 80 echo "cutting to-do-file" >> $scriptlog 2>&181 echo "getting no of lines" >> $scriptlog 2>&182 lines=`cat $todofile.txt | wc -l`83 echo "number of lines: "$lines >> $scriptlog 2>&184 while (( "$lines" < "$pno" ))85 do86 echo "# of lines ($lines) < # of processes ($pno) "87 pno=`expr $pno / 2`88 done89 echo "pno: "$pno >> $scriptlog 2>&190 nofiles=`expr $lines / \( $pno - 1 \)`91 echo "number of files: "$nofiles >> $scriptlog 2>&192 echo "deviding todo-file" >> $scriptlog 2>&193 for (( j=1 ; j <= $pno ; j++ ))94 do95 begin=$(echo "1 + ( ($j - 1) * $nofiles)" | bc -l)96 end=$(echo "$begin + $nofiles - 1" | bc -l)97 echo "begin: "$begin >> $scriptlog 2>&198 echo "end: "$end >> $scriptlog 2>&199 file=${todofile}-${j}.txt100 echo "file: "$file >> $scriptlog 2>&1101 sed -ne ''"$begin"','"$end"'w '"$file"'' $todofile.txt102 done103 104 rm -v $todofile.txt >> $scriptlog 2>&1105 80 fi 106 81 … … 109 84 nr=bla 110 85 echo "finding the right todo-file" >> $scriptlog 2>&1 111 for (( i = 1; i <= $pno ; i++ ))86 for todofile in ${todofiles[@]} 112 87 do 113 if ! ls $todofile -$i.txt>> $scriptlog 2>&188 if ! ls $todofile >> $scriptlog 2>&1 114 89 then 115 90 echo "file is not on disk -> continue" >> $scriptlog 2>&1 116 91 continue 117 92 fi 118 date > $lockpath/lock-$table-$column-$i.txt >> $scriptlog 2>&1 93 lockfile=`echo $todofile | sed -e 's/lists/locks/' -e 's/ToDo/lock/'` 94 date > $lockfile >> $scriptlog 2>&1 119 95 checklock=$? 120 96 case $checklock in … … 135 111 136 112 137 datasets=(`cat $todofile -$nr.txt`)113 datasets=(`cat $todofile`) 138 114 139 115 if [ "$datasets" = "" ] 140 116 then 141 117 echo "nothing to do -> exit" >> $scriptlog 2>&1 142 rm -v $todofile -$nr.txt>> $scriptlog 2>&1143 rm -v $lock path/lock-$table-$column-$nr.txt>> $scriptlog 2>&1118 rm -v $todofile >> $scriptlog 2>&1 119 rm -v $lockfile >> $scriptlog 2>&1 144 120 date >> $scriptlog 2>&1 145 121 exit … … 189 165 done 190 166 191 rm -v $todofile -$nr.txt>> $scriptlog 2>&1192 rm -v $lock path/lock-$table-$column-$nr.txt>> $scriptlog 2>&1167 rm -v $todofile >> $scriptlog 2>&1 168 rm -v $lockfile >> $scriptlog 2>&1 193 169 194 170 set +C -
trunk/MagicSoft/Mars/datacenter/scripts/runstar
r7233 r7256 37 37 datetime=`date +%F-%H-%M-%S` 38 38 year=`date +%Y` 39 pno=500 # number of processes, i.e. number of todo-files39 #pno=500 # number of processes, i.e. number of todo-files 40 40 41 41 todofile=$listpath/ToDo-$table-$column … … 77 77 *) echo "check0=$check0 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1;; 78 78 esac 79 echo "cutting to-do-file" >> $scriptlog 2>&180 echo "getting no of lines" >> $scriptlog 2>&181 lines=`cat $todofile.txt | wc -l`82 echo "number of lines: "$lines >> $scriptlog 2>&183 while (( "$lines" < "$pno" ))84 do85 echo "# of lines ($lines) < # of processes ($pno) "86 pno=`expr $pno / 2`87 done88 echo "pno: "$pno89 nofiles=`expr $lines / \( $pno - 1 \)`90 nofiles=`expr $nofiles + 1 `91 echo "number of files: "$nofiles >> $scriptlog 2>&192 echo "deviding todo-file" >> $scriptlog 2>&193 for (( j=1 ; j <= $pno ; j++ ))94 do95 begin=$(echo "1 + ( ($j - 1) * $nofiles)" | bc -l)96 end=$(echo "$begin + $nofiles - 1" | bc -l)97 echo "begin: "$begin >> $scriptlog 2>&198 echo "end: "$end >> $scriptlog 2>&199 file=${todofile}-${j}.txt100 echo "file: "$file >> $scriptlog 2>&1101 sed -ne ''"$begin"','"$end"'w '"$file"'' $todofile.txt102 done103 104 rm -v $todofile.txt >> $scriptlog 2>&1105 79 fi 106 80 … … 109 83 nr=bla 110 84 echo "finding the right todo-file" >> $scriptlog 2>&1 111 for (( i = 1; i <= $pno ; i++ )) 85 todofiles=`ls $listpath/*` 86 87 echo "todofiles: "${todofiles[@]} >> $scriptlog 2>&1 88 89 90 for todofile in ${todofiles[@]} 112 91 do 113 if ! ls $todofile -$i.txt>> $scriptlog 2>&192 if ! ls $todofile >> $scriptlog 2>&1 114 93 then 115 94 echo "file is not on disk -> continue" >> $scriptlog 2>&1 116 95 continue 117 96 fi 118 date > $lockpath/lock-$table-$column-$i.txt >> $scriptlog 2>&1 97 lockfile=`echo $todofile | sed -e 's/lists/locks/' -e 's/ToDo/lock/'` 98 date > $lockfile >> $scriptlog 2>&1 119 99 checklock=$? 120 100 case $checklock in … … 135 115 136 116 137 sequences=(`cat $todofile -$nr.txt`)117 sequences=(`cat $todofile`) 138 118 139 119 if [ "$sequences" = "" ] 140 120 then 141 121 echo "nothing to do -> exit" >> $scriptlog 2>&1 142 rm -v $todofile -$nr.txt>> $scriptlog 2>&1143 rm -v $lock path/lock-$table-$column-$nr.txt>> $scriptlog 2>&1122 rm -v $todofile >> $scriptlog 2>&1 123 rm -v $lockfile >> $scriptlog 2>&1 144 124 date >> $scriptlog 2>&1 145 125 exit … … 182 162 done 183 163 184 rm -v $todofile -$nr.txt>> $scriptlog 2>&1185 rm -v $lock path/lock-$table-$column-$nr.txt>> $scriptlog 2>&1164 rm -v $todofile >> $scriptlog 2>&1 165 rm -v $lockfile >> $scriptlog 2>&1 186 166 187 167 set +C
Note:
See TracChangeset
for help on using the changeset viewer.