Changeset 42440
- Timestamp:
- Mar 28, 2023, 2:43:59 PM (3 years ago)
- Location:
- trunk/tools/eam/rawfix.20230221/src
- Files:
-
- 14 edited
-
advance.rawfix.sh (modified) (4 diffs)
-
create.rawfix.sh (modified) (1 diff)
-
queue.rawfix.sh (modified) (2 diffs)
-
rawfix.advance.pt (modified) (3 diffs)
-
rawfix.ckchip.pt (modified) (1 diff)
-
rawfix.ckchip_s3.pt (modified) (3 diffs)
-
rawfix.fixchip.pt (modified) (1 diff)
-
rawfix.fixchip_s2.pt (modified) (2 diffs)
-
rawfix.fixchip_s3.pt (modified) (2 diffs)
-
rawfix.md5chk.pt (modified) (2 diffs)
-
rawfix.md5chk_s2.pt (modified) (2 diffs)
-
rawfix.md5sum.pt (modified) (3 diffs)
-
rawfix.md5sum_s2.pt (modified) (4 diffs)
-
rawfix.pt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/eam/rawfix.20230221/src/advance.rawfix.sh
r42430 r42440 2 2 3 3 if ($#argv < 1) then 4 echo "USAGE: advance.rawfix.sh all "4 echo "USAGE: advance.rawfix.sh all (Nmax)" 5 5 echo "USAGE: advance.rawfix.sh night (YYYYMMDD)" 6 6 exit 2 … … 9 9 set mode = $1 10 10 11 ## include a max number of active programs 11 12 if ($mode == "all") then 13 if ($#argv != 2) then 14 echo "USAGE: advance.rawfix.sh all (Nmax)" 15 exit 2 16 endif 17 18 set nMax = $2 19 set nActive = 0 20 set nAdvance = 0 12 21 set nights = `./check.rawfix.sh all | awk '(NR > 1){print $1}'` 13 22 foreach f ($nights) 14 echo -n "$f "15 23 ./advance.rawfix.sh night $f 24 set myResult = $status 25 if ($myResult == 1) continue 26 if ($myResult == 2) continue 27 if ($myResult == 3) continue 28 if ($myResult == 4) then 29 @ nActive ++ 30 endif 31 if ($myResult == 5) then 32 @ nActive ++ 33 @ nAdvance ++ 34 endif 35 if ($nActive >= $nMax) then 36 echo "advance $nAdvance nights, total of $nActive active nights" 37 exit 0 38 endif 16 39 end 40 echo "advance $nAdvance nights, total of $nActive active nights" 17 41 exit 0 18 42 endif 19 43 44 # advance STAGE0.done to STAGE1.new 45 # if already in STAGEx.new, return 4 46 # if setting to STAGEx.new, return 5 47 # otherwise, return 3 20 48 if ($mode == "night") then 21 49 if ($#argv != 2) then … … 29 57 30 58 set tgtstate = "NONE" 59 if ($mystate == "new") set tgtstate = "ckchip.new" 31 60 if ($mystate == "ckchip.done") set tgtstate = "fixchip.new" 32 61 if ($mystate == "fixchip.done") set tgtstate = "md5sum.new" … … 37 66 if ($mystate == "md5chk_s2.done") set tgtstate = "fixchip_s3.new" 38 67 if ($mystate == "fixchip_s3.done") set tgtstate = "ckchip_s3.new" 68 if ($mystate == "ckchip_s3.done") set tgtstate = "DONE" 39 69 40 if ($tgtstate == "NONE") then 41 echo "nothing to advance" 42 exit 0 43 endif 70 if ($mystate == "ckchip.new") set tgtstate = "ACTIVE" 71 if ($mystate == "fixchip.new") set tgtstate = "ACTIVE" 72 if ($mystate == "md5sum.new") set tgtstate = "ACTIVE" 73 if ($mystate == "md5chk.new") set tgtstate = "ACTIVE" 74 if ($mystate == "fixchip_s2.new") set tgtstate = "ACTIVE" 75 if ($mystate == "md5sum_s2.new") set tgtstate = "ACTIVE" 76 if ($mystate == "md5chk_s2.new") set tgtstate = "ACTIVE" 77 if ($mystate == "fixchip_s3.new") set tgtstate = "ACTIVE" 78 if ($mystate == "ckchip_s3.new") set tgtstate = "ACTIVE" 44 79 80 echo "$night : $mystate : $tgtstate" 81 82 # do not set these two states 83 if ($tgtstate == "NONE") exit 3 84 if ($tgtstate == "ACTIVE") exit 4 85 86 # only set these states 45 87 ./update.rawfix.sh $night $tgtstate 46 exit 0 88 89 if ($tgtstate == "DONE") exit 1 90 exit 5 47 91 endif 48 92 49 echo "ERROR: unknown mode: $mode 93 echo "ERROR: unknown mode: $mode" 50 94 exit 2 -
trunk/tools/eam/rawfix.20230221/src/create.rawfix.sh
r42399 r42440 9 9 create database $DBNAME; 10 10 use $DBNAME; 11 create table nights (night_id BIGINT AUTO_INCREMENT, dateobs char(64), state char(64), primary key (night_id) );11 create table nights (night_id BIGINT AUTO_INCREMENT, dateobs char(64), state char(64), primary key (night_id), unique (dateobs)); 12 12 EOF 13 13 -
trunk/tools/eam/rawfix.20230221/src/queue.rawfix.sh
r42399 r42440 1 1 #!/bin/csh 2 2 3 if ($#argv != 1) then 4 echo "USAGE: queue.rawfix.sh (mjddate)" 3 if ($#argv != 2) then 4 echo "USAGE: queue.rawfix.sh (list) (filename)" 5 echo "USAGE: queue.rawfix.sh (night) (YYYYMMDD)" 5 6 exit 2 6 7 endif 8 9 set mode = $1 7 10 8 11 # make the rawfix database to track rawfix operations … … 12 15 set DBPASS = "dvo" 13 16 14 ## XXX validate the format (YYYYMMDD)? 15 set mynight = $1 17 if ($mode == "list") then 18 set filename = $2 16 19 17 mysql -h $DBHOST -u $DBUSER -p$DBPASS $DBNAME -e "insert into nights (dateobs, state) values ('$mynight', 'new')" 20 # just a big list of dates? 21 foreach night (`cat $filename`) 22 queue.rawfix.sh night $night 23 end 24 exit 0 25 endif 26 27 if ($mode == "night") then 28 ## XXX validate the format (YYYYMMDD)? 29 set mynight = $2 30 31 mysql -h $DBHOST -u $DBUSER -p$DBPASS $DBNAME -e "insert into nights (dateobs, state) values ('$mynight', 'new')" 32 exit 0 33 endif 34 35 echo "ERROR: unknown mode $mode" 36 exit 2 -
trunk/tools/eam/rawfix.20230221/src/rawfix.advance.pt
r42429 r42440 1 2 $MAX_ACTIVE_NIGHTS = 2 1 3 2 4 ## regularly run the command advance.rawfits.sh … … 13 15 14 16 task.exec 15 command advance.rawfix.sh all 17 # 18 command advance.rawfix.sh all $MAX_ACTIVE_NIGHTS 16 19 end 17 20 … … 19 22 # by already-running load tasks 20 23 task.exit 0 21 echo "done with advance"22 24 end 23 25 -
trunk/tools/eam/rawfix.20230221/src/rawfix.ckchip.pt
r42430 r42440 78 78 79 79 # this is the first place in the proces that this location is known 80 mkdir $ DATEOBS81 stdout $ DATEOBS/log.ckchip.v082 stderr $ DATEOBS/log.ckchip.v080 mkdir $mypath/$DATEOBS 81 stdout $mypath/$DATEOBS/log.ckchip.runhosts.v0 82 stderr $mypath/$DATEOBS/log.ckchip.runhosts.v0 83 83 84 84 substr $DATEOBS 0 4 YEAR -
trunk/tools/eam/rawfix.20230221/src/rawfix.ckchip_s3.pt
r42430 r42440 61 61 npending 1 62 62 63 stdout $LOGDIR/ckchip_s3.run.stdout.log64 stderr $LOGDIR/ckchip_s3.run.stderr.log65 66 63 task.exec 67 64 # if we are unable to run the 'exec', use a long retry time … … 75 72 book getpage ckchip_s3.book 0 -var pageName -key pantaskState INIT 76 73 if ("$pageName" == "NULL") break 74 75 stdout $mypath/$DATEOBS/log.ckchip_s3.runhosts.v0 76 stderr $mypath/$DATEOBS/log.ckchip_s3.runhosts.v0 77 77 78 78 book setword ckchip_s3.book $pageName pantaskState RUN … … 89 89 end 90 90 91 # # XX delete the page from the book if done?91 # SUCCESS 92 92 task.exit 0 93 queuepush stdout "------- end of stdout ---------"94 queuesave stdout $options:0/log.ckchip_s3.v195 queuepush stderr "------- end of stderr ---------"96 queuesave stderr $options:0/log.ckchip_s3.v197 93 book setword ckchip_s3.book $options:0 pantaskState DONE 98 94 exec update.rawfix.sh $options:0 ckchip_s3.done -
trunk/tools/eam/rawfix.20230221/src/rawfix.fixchip.pt
r42430 r42440 60 60 npending 1 61 61 62 stdout $LOGDIR/fixchip.run.stdout.log63 stderr $LOGDIR/fixchip.run.stderr.log64 65 62 task.exec 66 63 # if we are unable to run the 'exec', use a long retry time -
trunk/tools/eam/rawfix.20230221/src/rawfix.fixchip_s2.pt
r42430 r42440 60 60 npending 1 61 61 62 stdout $LOGDIR/fixchip_s2.run.stdout.log63 stderr $LOGDIR/fixchip_s2.run.stderr.log64 65 62 task.exec 66 63 # if we are unable to run the 'exec', use a long retry time … … 83 80 substr $DATEOBS 6 2 DAY 84 81 sprintf FULLDATE "%s/%s/%s" $YEAR $MONTH $DAY 82 83 # does the output go here? 84 stdout $mypath/$DATEOBS/log.fixchip_s2.runhosts.v0 85 stderr $mypath/$DATEOBS/log.fixchip_s2.runhosts.v0 85 86 86 87 command fix_chip_locations_stage2.pl --dateobs $FULLDATE --chiplist gpc1.chips.txt --stage v0 -
trunk/tools/eam/rawfix.20230221/src/rawfix.fixchip_s3.pt
r42417 r42440 60 60 npending 1 61 61 62 stdout $LOGDIR/fixchip_s3.run.stdout.log63 stderr $LOGDIR/fixchip_s3.run.stderr.log64 65 62 task.exec 66 63 # if we are unable to run the 'exec', use a long retry time … … 83 80 substr $DATEOBS 6 2 DAY 84 81 sprintf FULLDATE "%s/%s/%s" $YEAR $MONTH $DAY 82 83 # does the output go here? 84 stdout $mypath/$DATEOBS/log.fixchip_s3.runhosts.v0 85 stderr $mypath/$DATEOBS/log.fixchip_s3.runhosts.v0 85 86 86 87 command fix_chip_locations_stage3.pl --dateobs $FULLDATE --chiplist gpc1.chips.txt -
trunk/tools/eam/rawfix.20230221/src/rawfix.md5chk.pt
r42411 r42440 59 59 npending 1 60 60 61 stdout $LOGDIR/md5chk.run.stdout.log62 stderr $LOGDIR/md5chk.run.stderr.log63 64 61 task.exec 65 62 # if we are unable to run the 'exec', use a long retry time … … 83 80 sprintf FULLDATE "%s/%s/%s" $YEAR $MONTH $DAY 84 81 85 # send output to a file in the DATEOBS directory 86 stdout $DATEOBS/md5chk.log 82 # does the output go here? 83 stdout $mypath/$DATEOBS/log.md5chk.v0 84 stderr $mypath/$DATEOBS/log.md5chk.v0 87 85 88 86 command check_md5s_dateobs.pl --dateobs $FULLDATE -
trunk/tools/eam/rawfix.20230221/src/rawfix.md5chk_s2.pt
r42415 r42440 59 59 npending 1 60 60 61 stdout $LOGDIR/md5chk_s2.run.stdout.log62 stderr $LOGDIR/md5chk_s2.run.stderr.log63 64 61 task.exec 65 62 # if we are unable to run the 'exec', use a long retry time … … 83 80 sprintf FULLDATE "%s/%s/%s" $YEAR $MONTH $DAY 84 81 85 # send output to a file in the DATEOBS directory 86 stdout $DATEOBS/md5chk_s2.log 82 # does the output go here? 83 stdout $mypath/$DATEOBS/log.md5chk_s2.v0 84 stderr $mypath/$DATEOBS/log.md5chk_s2.v0 87 85 88 86 command check_md5s_dateobs.pl --dateobs $FULLDATE -
trunk/tools/eam/rawfix.20230221/src/rawfix.md5sum.pt
r42430 r42440 82 82 83 83 # write an entry point in the log for this night 84 sprintf tmpline "%s/%s/ md5sum.runhosts.log" $mypath $DATEOBS84 sprintf tmpline "%s/%s/log.md5sum.runhosts.v0" $mypath $DATEOBS 85 85 date -var mydate 86 86 exec echo "# start runhosts $mydate" >> $tmpline … … 143 143 # save DATEOBS so we can find the md5sum.book entry 144 144 145 # does the output go here? 145 146 stdout $mypath/$DATEOBS/log.md5sum.runhosts.v0 146 147 stderr $mypath/$DATEOBS/log.md5sum.runhosts.v0 … … 268 269 if ("$1" != "OK") 269 270 book setword md5sum.book $options:1 pantasksQuality $1 270 sprintf tmpline "%s/%s/ md5sum.runhosts.log" $mypath $options:1271 sprintf tmpline "%s/%s/log.md5sum.runhosts.v0" $mypath $options:1 271 272 exec echo "failure $1 $options:0" >> $tmpline 272 273 else -
trunk/tools/eam/rawfix.20230221/src/rawfix.md5sum_s2.pt
r42430 r42440 82 82 83 83 # write an entry point in the log for this night 84 sprintf tmpline "%s/%s/ md5sum_s2.runhosts.log" $mypath $DATEOBS84 sprintf tmpline "%s/%s/log.md5sum_s2.runhosts.v0" $mypath $DATEOBS 85 85 date -var mydate 86 86 exec echo "# start runhosts $mydate" >> $tmpline … … 124 124 periods -timeout 60 125 125 126 stdout $LOGDIR/md5sum_s2.runhosts.stdout.log127 stderr $LOGDIR/md5sum_s2.runhosts.stderr.log128 129 126 task.exec 130 127 # if we are unable to run the 'exec', use a long retry time … … 145 142 option $pageName $DATEOBS 146 143 # save DATEOBS so we can find the md5sum_s2.book entry 144 145 # does the output go here? 146 stdout $mypath/$DATEOBS/log.md5sum_s2.runhosts.v0 147 stderr $mypath/$DATEOBS/log.md5sum_s2.runhosts.v0 147 148 148 149 # XXX TEST: $USE_HOST = ipp060 … … 270 271 if ("$1" != "OK") 271 272 book setword md5sum_s2.book $options:1 pantasksQuality $1 272 sprintf tmpline "%s/%s/ md5sum_s2.runhosts.log" $mypath $options:1273 sprintf tmpline "%s/%s/log.md5sum_s2.runhosts.v0" $mypath $options:1 273 274 exec echo "failure $1 $options:0" >> $tmpline 274 275 else -
trunk/tools/eam/rawfix.20230221/src/rawfix.pt
r42430 r42440 23 23 # order is this file is not determinative, only the 24 24 # change of state from STAGE1.new -> STAGE1.done -> STAGE2.new 25 #input rawfix.advance.pt25 input rawfix.advance.pt 26 26 input rawfix.ckchip.pt 27 #input rawfix.fixchip.pt28 #input rawfix.md5sum.pt29 #input rawfix.md5chk.pt30 #input rawfix.fixchip_s2.pt31 #input rawfix.md5sum_s2.pt32 #input rawfix.md5chk_s2.pt33 #input rawfix.fixchip_s3.pt27 input rawfix.fixchip.pt 28 input rawfix.md5sum.pt 29 input rawfix.md5chk.pt 30 input rawfix.fixchip_s2.pt 31 input rawfix.md5sum_s2.pt 32 input rawfix.md5chk_s2.pt 33 input rawfix.fixchip_s3.pt 34 34 35 35 # no need to run rsync if we use the b-node working directory:
Note:
See TracChangeset
for help on using the changeset viewer.
