Changeset 42430
- Timestamp:
- Mar 23, 2023, 2:05:41 PM (3 years ago)
- Location:
- trunk/tools/eam/rawfix.20230221/src
- Files:
-
- 2 added
- 14 edited
-
advance.rawfix.sh (modified) (2 diffs)
-
check.rawfix.sh (modified) (1 diff)
-
check_chip_locations.pl (modified) (6 diffs)
-
fix_chip_locations.pl (modified) (6 diffs)
-
fix_chip_locations_stage2.pl (modified) (5 diffs)
-
get_hosts_md5s.sh (modified) (2 diffs)
-
get_md5s_instances.pl (modified) (3 diffs)
-
get_md5s_instances_stage2.pl (modified) (3 diffs)
-
rawfix.ckchip.pt (modified) (4 diffs)
-
rawfix.ckchip_s3.pt (added)
-
rawfix.fixchip.pt (modified) (2 diffs)
-
rawfix.fixchip_s2.pt (modified) (1 diff)
-
rawfix.md5sum.pt (modified) (4 diffs)
-
rawfix.md5sum_s2.pt (modified) (2 diffs)
-
rawfix.pt (modified) (1 diff)
-
select.nights.sql (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/eam/rawfix.20230221/src/advance.rawfix.sh
r42429 r42430 36 36 if ($mystate == "md5sum_s2.done") set tgtstate = "md5chk_s2.new" 37 37 if ($mystate == "md5chk_s2.done") set tgtstate = "fixchip_s3.new" 38 if ($mystate == "fixchip_s3.done") set tgtstate = "ckchip_s3.new" 38 39 39 40 if ($tgtstate == "NONE") then … … 46 47 endif 47 48 49 echo "ERROR: unknown mode: $mode 50 exit 2 -
trunk/tools/eam/rawfix.20230221/src/check.rawfix.sh
r42416 r42430 89 89 if ($mystate == "fixchip_s3.done") goto good_state 90 90 if ($mystate == "fixchip_s3.fail") goto good_state 91 if ($mystate == "ckchip_s3.new") goto good_state 92 if ($mystate == "ckchip_s3.done") goto good_state 93 if ($mystate == "ckchip_s3.fail") goto good_state 91 94 92 95 # disable the rsyncs stages: run in directory from b-node -
trunk/tools/eam/rawfix.20230221/src/check_chip_locations.pl
r42415 r42430 13 13 use Getopt::Long qw( GetOptions :config auto_help auto_version ); 14 14 15 # USAGE: check_chip_locations.pl --dateobs (night) --chiplist (file) 16 # USAGE: check_chip_locations.pl --dateobs 2010/05/01 --chiplist gpc1.chips.txt 17 18 my ($fulldate, $dateword, $chiplist ) = &parse_cmdopts;15 # USAGE: check_chip_locations.pl --dateobs (night) --chiplist (file) --stage (v0,v1,etc) 16 # USAGE: check_chip_locations.pl --dateobs 2010/05/01 --chiplist gpc1.chips.txt --stage v0 17 18 my ($fulldate, $dateword, $chiplist, $stage) = &parse_cmdopts; 19 19 my ($neb_dbh, $gpc_dbh) = &parse_db_config ('nebulous.config'); 20 20 … … 30 30 31 31 # output files: 32 # instance lists by host: YYYYMMDD/HOSTNAME.inst. txt32 # instance lists by host: YYYYMMDD/HOSTNAME.inst.STAGE.txt 33 33 # chip states by chip: YYYYMMDD/CHIPNAME.uris.txt 34 34 … … 79 79 my @hostnames = keys %hostcount; 80 80 foreach my $myname (@hostnames) { 81 print $hostfh " host $myname =$hostcount{$myname}\n";81 print $hostfh "$myname $hostcount{$myname}\n"; 82 82 } 83 83 close ($hostfh); … … 231 231 232 232 if (not defined $hostfile{$hostname}) { 233 open ($hostfile{$hostname}, ">$dateword/$hostname.inst. txt");233 open ($hostfile{$hostname}, ">$dateword/$hostname.inst.$stage.txt"); 234 234 ## XXX deal with open failure here 235 235 } … … 330 330 sub parse_cmdopts { 331 331 332 my ($dateobs, $chiplist );333 GetOptions( 'dateobs=s' => \$dateobs, 'chiplist=s' => \$chiplist ) || pod2usage(2);332 my ($dateobs, $chiplist, $stage); 333 GetOptions( 'dateobs=s' => \$dateobs, 'chiplist=s' => \$chiplist, 'stage=s' => \$stage) || pod2usage(2); 334 334 335 335 pod2usage( -msg => "Cannot determine target date, use --dateobs YYYY/MM/DD", -exitval => 2) unless defined $dateobs; 336 336 pod2usage( -msg => "Provide a list of chips with --chiplist", -exitval => 2) unless defined $chiplist; 337 pod2usage( -msg => "Define the stage (v0, v1, etc) with --stage", -exitval => 2) unless defined $stage; 337 338 338 339 # check the date format (require YYYY/MM/DD and use that from 00:00:00 to 23:59:59 or take start and end?) … … 343 344 pod2usage( -msg => "Cannot interpret date, use YYYY/MM/DD", -exitval => 2) if ($date_month < 1) or ($date_month > 12); 344 345 pod2usage( -msg => "Cannot interpret date, use YYYY/MM/DD", -exitval => 2) if ($date_day < 1) or ($date_day > 31); 346 345 347 my $fulldate = "$date_year/$date_month/$date_day"; 346 347 348 my $dateword = sprintf ("%4d%02d%02d", $date_year, $date_month, $date_day); 348 349 349 return ($fulldate, $dateword, $chiplist )350 return ($fulldate, $dateword, $chiplist, $stage) 350 351 } 351 352 -
trunk/tools/eam/rawfix.20230221/src/fix_chip_locations.pl
r42415 r42430 12 12 use Getopt::Long qw( GetOptions :config auto_help auto_version ); 13 13 14 # USAGE: fix_chip_locations.pl --dateobs (night) --chiplist (file) 14 # USAGE: fix_chip_locations.pl --dateobs (night) --chiplist (file) --stage (v0,v1,etc) 15 15 16 16 # we need to select targets for ITC copies of files currently only at ATRC: … … 18 18 # for each chip, target a single host? 19 19 20 my ($fulldate, $dateword, $chiplist ) = &parse_cmdopts;20 my ($fulldate, $dateword, $chiplist, $stage) = &parse_cmdopts; 21 21 my ($neb_dbh) = &parse_db_config ('nebulous.config'); 22 22 … … 71 71 my ($newfile, $newhost, $newxattr) = &get_new_instance ($ext_id); 72 72 unless ($newxattr == 1) { die "new instance is not at ATRC? $ext_id : $newfile : $newhost : $newxattr\n"; } 73 open (OUTFILE, ">>$dateword/$newhost.inst. txt");73 open (OUTFILE, ">>$dateword/$newhost.inst.$stage.txt"); 74 74 print OUTFILE "$newfile $datast $md5sum\n"; 75 75 close (OUTFILE); … … 85 85 my ($newfile, $newhost, $newxattr) = &get_new_instance ($ext_id); 86 86 unless ($newxattr == 0) { die "new instance is not at ITC? $ext_id : $newfile : $newhost : $newxattr\n"; } 87 open (OUTFILE, ">>$dateword/$newhost.inst. txt");87 open (OUTFILE, ">>$dateword/$newhost.inst.$stage.txt"); 88 88 print OUTFILE "$newfile $datast $md5sum\n"; 89 89 close (OUTFILE); … … 189 189 sub parse_cmdopts { 190 190 191 my ($dateobs, $chiplist );192 GetOptions( 'dateobs=s' => \$dateobs, 'chiplist=s' => \$chiplist ) || pod2usage(2);191 my ($dateobs, $chiplist, $stage); 192 GetOptions( 'dateobs=s' => \$dateobs, 'chiplist=s' => \$chiplist, 'stage=s' => \$stage) || pod2usage(2); 193 193 194 194 pod2usage( -msg => "Cannot determine target date, use --dateobs YYYY/MM/DD", -exitval => 2) unless defined $dateobs; 195 195 pod2usage( -msg => "Provide a list of chips with --chiplist", -exitval => 2) unless defined $chiplist; 196 pod2usage( -msg => "Define the stage (v0, v1, etc) with --stage", -exitval => 2) unless defined $stage; 196 197 197 198 # check the date format (require YYYY/MM/DD and use that from 00:00:00 to 23:59:59 or take start and end?) … … 206 207 my $dateword = sprintf ("%4d%02d%02d", $date_year, $date_month, $date_day); 207 208 208 return ($fulldate, $dateword, $chiplist );209 return ($fulldate, $dateword, $chiplist, $stage); 209 210 } 210 211 -
trunk/tools/eam/rawfix.20230221/src/fix_chip_locations_stage2.pl
r42415 r42430 12 12 use Getopt::Long qw( GetOptions :config auto_help auto_version ); 13 13 14 # USAGE: fix_chip_locations.pl --dateobs (night) --chiplist (file) 14 # USAGE: fix_chip_locations.pl --dateobs (night) --chiplist (file) --stage (v0,v1,etc) 15 15 16 16 # we need to select targets for ITC copies of files currently only at ATRC: … … 18 18 # for each chip, target a single host? 19 19 20 my ($fulldate, $dateword, $chiplist ) = &parse_cmdopts;20 my ($fulldate, $dateword, $chiplist, $stage) = &parse_cmdopts; 21 21 my ($neb_dbh) = &parse_db_config ('nebulous.config'); 22 22 … … 75 75 my ($newfile, $newhost, $newxattr) = &get_new_instance ($ext_id); 76 76 unless ($newxattr == 1) { die "new instance is not at ATRC? $ext_id : $newfile : $newhost : $newxattr\n"; } 77 open (OUTFILE, ">>$dateword/$newhost.inst. txt");77 open (OUTFILE, ">>$dateword/$newhost.inst.$stage.txt"); 78 78 print OUTFILE "$newfile $datast $md5sum\n"; 79 79 close (OUTFILE); … … 189 189 sub parse_cmdopts { 190 190 191 my ($dateobs, $chiplist );192 GetOptions( 'dateobs=s' => \$dateobs, 'chiplist=s' => \$chiplist ) || pod2usage(2);191 my ($dateobs, $chiplist, $stage); 192 GetOptions( 'dateobs=s' => \$dateobs, 'chiplist=s' => \$chiplist, 'stage=s' => \$stage) || pod2usage(2); 193 193 194 194 pod2usage( -msg => "Cannot determine target date, use --dateobs YYYY/MM/DD", -exitval => 2) unless defined $dateobs; 195 195 pod2usage( -msg => "Provide a list of chips with --chiplist", -exitval => 2) unless defined $chiplist; 196 pod2usage( -msg => "Define the stage (v0, v1, etc) with --stage", -exitval => 2) unless defined $stage; 196 197 197 198 # check the date format (require YYYY/MM/DD and use that from 00:00:00 to 23:59:59 or take start and end?) … … 206 207 my $dateword = sprintf ("%4d%02d%02d", $date_year, $date_month, $date_day); 207 208 208 return ($fulldate, $dateword, $chiplist );209 return ($fulldate, $dateword, $chiplist, $stage); 209 210 } 210 211 -
trunk/tools/eam/rawfix.20230221/src/get_hosts_md5s.sh
r42404 r42430 1 1 #!/bin/csh 2 2 3 if ($#argv != 1) then4 echo "USAGE: get_hosts_md5s.sh (dateobs) "3 if ($#argv != 2) then 4 echo "USAGE: get_hosts_md5s.sh (dateobs) (stage)" 5 5 exit 2 6 6 endif 7 7 8 8 set dirname = $1 9 set stage = $2 9 10 10 11 if (! -d $dirname) then … … 14 15 15 16 # report both the dateobs and the hostnames 16 ls $dirname/*.inst. txt | awk -v dateobs=$dirname -F/ '(NR == 1){print "dateobs md5host"}{print dateobs, $2}' | sed s/.inst.txt//17 ls $dirname/*.inst.$stage.txt | awk -v dateobs=$dirname -F/ '(NR == 1){print "dateobs md5host"}{print dateobs, $2}' | sed s/.inst.$stage.txt// 17 18 exit 0 -
trunk/tools/eam/rawfix.20230221/src/get_md5s_instances.pl
r42411 r42430 11 11 use Getopt::Long qw( GetOptions :config auto_help auto_version ); 12 12 13 # USAGE: get_md5s_instances.pl --hostname (hostname) --input (file) 13 # USAGE: get_md5s_instances.pl --hostname (hostname) --input (file) --stage (v0,v1,etc) 14 14 15 my ($myhost, $input ) = &parse_cmdopts;15 my ($myhost, $input, $stage) = &parse_cmdopts; 16 16 17 17 # check that we are running this script on 'myhost' … … 23 23 24 24 my $output = $input; 25 $output =~ s/inst /md5s/;25 $output =~ s/inst.$stage/md5s/; 26 26 27 27 if ($output eq $input) { die "output file ($output) matches input file ($input)\n"; } … … 84 84 sub parse_cmdopts { 85 85 86 my ($myhost, $input );87 GetOptions( 'hostname=s' => \$myhost, 'input=s' => \$input ) || pod2usage(2);86 my ($myhost, $input, $stage); 87 GetOptions( 'hostname=s' => \$myhost, 'input=s' => \$input, 'stage=s' => \$stage) || pod2usage(2); 88 88 89 89 pod2usage( -msg => "Provide the input list with --input", -exitval => 2) unless defined $input; 90 90 pod2usage( -msg => "Define the host machine with --hostname", -exitval => 2) unless defined $myhost; 91 pod2usage( -msg => "Define the stage (v0, v1, etc) with --stage", -exitval => 2) unless defined $stage; 91 92 92 return ($myhost, $input );93 return ($myhost, $input, $stage); 93 94 } 94 95 -
trunk/tools/eam/rawfix.20230221/src/get_md5s_instances_stage2.pl
r42415 r42430 11 11 use Getopt::Long qw( GetOptions :config auto_help auto_version ); 12 12 13 # USAGE: get_md5s_instances.pl --hostname (hostname) --input (file) 13 # USAGE: get_md5s_instances.pl --hostname (hostname) --input (file) --stage (v0,v1,etc) 14 14 15 my ($myhost, $input ) = &parse_cmdopts;15 my ($myhost, $input, $stage) = &parse_cmdopts; 16 16 17 17 # check that we are running this script on 'myhost' … … 23 23 24 24 my $output = $input; 25 $output =~ s/inst /md5s/;25 $output =~ s/inst.$stage/md5s/; 26 26 27 27 if ($output eq $input) { die "output file ($output) matches input file ($input)\n"; } … … 117 117 sub parse_cmdopts { 118 118 119 my ($myhost, $input );120 GetOptions( 'hostname=s' => \$myhost, 'input=s' => \$input ) || pod2usage(2);119 my ($myhost, $input, $stage); 120 GetOptions( 'hostname=s' => \$myhost, 'input=s' => \$input, 'stage=s' => \$stage) || pod2usage(2); 121 121 122 122 pod2usage( -msg => "Provide the input list with --input", -exitval => 2) unless defined $input; 123 123 pod2usage( -msg => "Define the host machine with --hostname", -exitval => 2) unless defined $myhost; 124 pod2usage( -msg => "Define the stage (v0, v1, etc) with --stage", -exitval => 2) unless defined $stage; 124 125 125 return ($myhost, $input );126 return ($myhost, $input, $stage); 126 127 } 127 128 -
trunk/tools/eam/rawfix.20230221/src/rawfix.ckchip.pt
r42411 r42430 61 61 npending 1 62 62 63 stdout $LOGDIR/ckchip.run.stdout.log64 stderr $LOGDIR/ckchip.run.stderr.log65 66 63 task.exec 67 64 # if we are unable to run the 'exec', use a long retry time … … 80 77 option $pageName 81 78 79 # this is the first place in the proces that this location is known 80 mkdir $DATEOBS 81 stdout $DATEOBS/log.ckchip.v0 82 stderr $DATEOBS/log.ckchip.v0 83 82 84 substr $DATEOBS 0 4 YEAR 83 85 substr $DATEOBS 4 2 MONTH … … 86 88 sprintf FULLDATE "%s/%s/%s" $YEAR $MONTH $DAY 87 89 88 command check_chip_locations.pl --dateobs $FULLDATE --chiplist gpc1.chips.txt 90 command check_chip_locations.pl --dateobs $FULLDATE --chiplist gpc1.chips.txt --stage v0 89 91 end 90 92 91 # # XX delete the page from the book if done?93 # mark the entry done, will be deleted above in .load 92 94 task.exit 0 93 # convert the stdout 'queue' to entries in a book94 # fields in the table will become words in the page95 # use the queuesize (Nhosts) to track how many jobs are done / to be done96 95 book setword ckchip.book $options:0 pantaskState DONE 97 96 exec update.rawfix.sh $options:0 ckchip.done … … 119 118 end 120 119 120 # option for writing stdout / stderr to a file 121 # queuepush stdout "------- end of stdout ---------" 122 # queuesave stdout $options:0/log.ckchip.v0 123 # queuepush stderr "------- end of stderr ---------" 124 # queuesave stderr $options:0/log.ckchip.v0 -
trunk/tools/eam/rawfix.20230221/src/rawfix.fixchip.pt
r42417 r42430 79 79 option $pageName 80 80 81 stdout $pageName/log.fixchip.v0 82 stderr $pageName/log.fixchip.v0 83 81 84 substr $DATEOBS 0 4 YEAR 82 85 substr $DATEOBS 4 2 MONTH … … 84 87 sprintf FULLDATE "%s/%s/%s" $YEAR $MONTH $DAY 85 88 86 command fix_chip_locations.pl --dateobs $FULLDATE --chiplist gpc1.chips.txt 89 command fix_chip_locations.pl --dateobs $FULLDATE --chiplist gpc1.chips.txt --stage v0 87 90 end 88 91 89 92 ## XX delete the page from the book if done? 90 93 task.exit 0 91 # convert the stdout 'queue' to entries in a book92 # fields in the table will become words in the page93 # use the queuesize (Nhosts) to track how many jobs are done / to be done94 94 book setword fixchip.book $options:0 pantaskState DONE 95 95 exec update.rawfix.sh $options:0 fixchip.done -
trunk/tools/eam/rawfix.20230221/src/rawfix.fixchip_s2.pt
r42417 r42430 84 84 sprintf FULLDATE "%s/%s/%s" $YEAR $MONTH $DAY 85 85 86 command fix_chip_locations_stage2.pl --dateobs $FULLDATE --chiplist gpc1.chips.txt 86 command fix_chip_locations_stage2.pl --dateobs $FULLDATE --chiplist gpc1.chips.txt --stage v0 87 87 end 88 88 -
trunk/tools/eam/rawfix.20230221/src/rawfix.md5sum.pt
r42417 r42430 86 86 exec echo "# start runhosts $mydate" >> $tmpline 87 87 88 command get_hosts_md5s.sh $DATEOBS 88 command get_hosts_md5s.sh $DATEOBS v0 89 89 end 90 90 … … 124 124 periods -timeout 60 125 125 126 stdout $LOGDIR/md5sum.runhosts.stdout.log127 stderr $LOGDIR/md5sum.runhosts.stderr.log128 129 126 task.exec 130 127 # if we are unable to run the 'exec', use a long retry time … … 146 143 # save DATEOBS so we can find the md5sum.book entry 147 144 145 stdout $mypath/$DATEOBS/log.md5sum.runhosts.v0 146 stderr $mypath/$DATEOBS/log.md5sum.runhosts.v0 147 148 148 # XXX TEST: $USE_HOST = ipp060 149 150 149 $USE_HOST = $MD5HOST 151 150 host -required $USE_HOST … … 161 160 162 161 ## even when testing, use the original hostname here: 163 $input = $mypath/$DATEOBS/$MD5HOST.inst. txt162 $input = $mypath/$DATEOBS/$MD5HOST.inst.v0.txt 164 163 165 164 # need to make sure this will work on the ipp b-nodes: 166 165 # if we are able to run the 'exec', use a short retry time to launch all outstanding jobs 167 166 periods -exec 0.05 168 command $mypath/get_md5s_instances.pl --hostname $USE_HOST --input $input 167 command $mypath/get_md5s_instances.pl --hostname $USE_HOST --input $input --stage v0 169 168 end 170 169 -
trunk/tools/eam/rawfix.20230221/src/rawfix.md5sum_s2.pt
r42417 r42430 86 86 exec echo "# start runhosts $mydate" >> $tmpline 87 87 88 command get_hosts_md5s.sh $DATEOBS 88 command get_hosts_md5s.sh $DATEOBS v0 89 89 end 90 90 … … 161 161 162 162 ## even when testing, use the original hostname here: 163 $input = $mypath/$DATEOBS/$MD5HOST.inst. txt163 $input = $mypath/$DATEOBS/$MD5HOST.inst.v0.txt 164 164 165 165 # need to make sure this will work on the ipp b-nodes: 166 166 # if we are able to run the 'exec', use a short retry time to launch all outstanding jobs 167 167 periods -exec 0.05 168 command $mypath/get_md5s_instances_stage2.pl --hostname $USE_HOST --input $input 168 command $mypath/get_md5s_instances_stage2.pl --hostname $USE_HOST --input $input --stage v0 169 169 end 170 170 -
trunk/tools/eam/rawfix.20230221/src/rawfix.pt
r42417 r42430 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.pt 25 26 input rawfix.ckchip.pt 26 input rawfix.fixchip.pt27 input rawfix.md5sum.pt28 input rawfix.md5chk.pt29 input rawfix.fixchip_s2.pt30 input rawfix.md5sum_s2.pt31 input rawfix.md5chk_s2.pt32 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 33 34 34 35 # no need to run rsync if we use the b-node working directory:
Note:
See TracChangeset
for help on using the changeset viewer.
